Make timeout field have default value

This commit is contained in:
powe97 2024-02-29 22:28:00 -05:00
parent 682b1679b4
commit c6e28d399a
No known key found for this signature in database
GPG key ID: 7D1663B10978D1BA

View file

@ -107,15 +107,15 @@ def scrape_course_card(html_id, i, note):
def main():
global driver
if len(sys.argv) != 4:
if len(sys.argv) != 3 && len(sys.argv) != 4:
print(
f"USAGE: python {sys.argv[0]} <transfer file> <state file> <timeout minutes>"
f"USAGE: python {sys.argv[0]} <transfer file> <state file> [timeout minutes]"
)
exit(1)
transfer_json_path = sys.argv[1]
state_json_path = sys.argv[2]
timeout_seconds = int(sys.argv[3]) * 60
timeout_seconds = int(sys.argv[3] or 120) * 60
# Set up timeout so that the GH action does not run forever, pretend it's ^C
signal(SIGALRM, lambda a, b: raise_(KeyboardInterrupt))