From 1f97d3f817eac207779622275a3d8a5feb4d387f Mon Sep 17 00:00:00 2001 From: Joachim Meyer Date: Tue, 25 Mar 2025 09:11:13 +0100 Subject: [PATCH] Make stop script more stable.. --- scripts/stop-jobs-no-longer-running.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/stop-jobs-no-longer-running.py b/scripts/stop-jobs-no-longer-running.py index a59cc95..f166db3 100644 --- a/scripts/stop-jobs-no-longer-running.py +++ b/scripts/stop-jobs-no-longer-running.py @@ -76,9 +76,10 @@ def get_entered_current_status(arrayId, jobId, startTime): return history[0]['EnteredCurrentStatus'] querys = subprocess.run( ["ssh", conduit + ".cs.uni-saarland.de", "condor_q", "-json", condor_job_id], capture_output=True, text=True).stdout - query = json.loads(querys) - if len(query) > 0: - return query[0]['EnteredCurrentStatus'] + if len(querys) > 0: + query = json.loads(querys) + if len(query) > 0: + return query[0]['EnteredCurrentStatus'] return startTime + 1 if __name__ == "__main__":