From 62b78c341cfc8aa560abad5d096a40e6dc39be73 Mon Sep 17 00:00:00 2001 From: "M. Morgan Aster" Date: Thu, 27 Feb 2025 15:36:30 -0500 Subject: [PATCH] remove 15 min timeout from poll_job_status (#1519) * remove 15 min timeout from poll_job_status * add a log when submission is done --- scripts/firecloud_api/firecloud_api.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/firecloud_api/firecloud_api.py b/scripts/firecloud_api/firecloud_api.py index f50544992d..c0b43aae6f 100644 --- a/scripts/firecloud_api/firecloud_api.py +++ b/scripts/firecloud_api/firecloud_api.py @@ -338,19 +338,12 @@ def poll_job_status(self, submission_id): workflow_status_map = {} # Set up retry parameters - max_retry_duration = 15 * 60 # 15 minutes in seconds start_time = time.time() retry_delay = 5 # Start with a 5-second delay between retries max_retry_delay = 30 # Maximum retry delay in seconds # Continuously poll the status of the submission until completion while True: - # Check if we've exceeded the maximum retry duration - current_time = time.time() - if current_time - start_time > max_retry_duration: - logging.error(f"Exceeded maximum retry duration of {max_retry_duration/60} minutes.") - return workflow_status_map - try: # Get the token and headers token = self.get_user_token(self.delegated_creds) @@ -398,6 +391,7 @@ def poll_job_status(self, submission_id): # Check if the submission is complete submission_status = status_data.get("status", "") if submission_status == "Done": + logging.info("Submission is done.") break # Wait for 20 seconds before polling again @@ -411,6 +405,7 @@ def poll_job_status(self, submission_id): retry_delay = min(retry_delay * 1.5, max_retry_delay) return workflow_status_map + def quote_values(self, inputs_json): """ Format JSON values with proper handling of nested structures