WASHINGTON — When Treasury Secretary Steven Mnuchin rushed to the Capitol on Tuesday to pitch Senate Republicans on a $1 trillion coronavirus relief package, the chamber had already moved into crisis mode as lawmakers confronted a growing sense of urgency to act before much of the nation shuts down.

Senate Democrats abandoned their weekly policy luncheon for a teleconference, while about four dozen Republicans, joined by Mr. Mnuchin, practiced social distancing by moving their lunch from their usual 80-seat room in the Capitol to one across the street that seats 200. Instead of 10 senators at each table, there were five. The buffet line was gone; gloved servers dished out tuna, egg salad and chicken.

Despite public health officials’ pleas to employers to keep their workers at home, the Senate — whose members include a high volume of septuagenarians and octogenarians considered particularly vulnerable to coronavirus — has continued to meet. One reason is that lawmakers are rushing to pass legislation to provide relief to workers and businesses. Another is that they are reluctant to shutter the Capitol, a potent symbol in the United States and around the world of a functioning government in trying times.

But on Wednesday, they received a sobering reminder of the risks. Representative Mario Diaz-Balart, Republican of Florida, and Representative Ben McAdams, Democrat of Utah, became the first members of Congress to discover they were infected with the coronavirus. The House is on recess, but the Senate soldiered on.