From 19e70cf753fb23af288ca180eb53ab3f55e6c743 Mon Sep 17 00:00:00 2001 From: Loraine Gueguen <loraine.gueguen@sb-roscoff.fr> Date: Wed, 12 May 2021 00:39:03 +0200 Subject: [PATCH] uncomment checking job state --- gga_load_data.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gga_load_data.py b/gga_load_data.py index f240f62..8ff4a82 100755 --- a/gga_load_data.py +++ b/gga_load_data.py @@ -209,19 +209,19 @@ class LoadData(speciesData.SpeciesData): logging.info("Waiting for import jobs to finish... please wait") # Checking job state (only necessary if ran using SLURM) - # while True: - # try: - # # "C" state means the job is completed, no need to wait for it - # ret = subprocess.check_output("squeue | grep -v \"C debug\" | grep -v \"JOBID\" || true", - # shell=True) - # if not len(ret): - # break - # time.sleep(3) - # except subprocess.CalledProcessError as inst: - # if inst.returncode == 153: # queue is empty - # break - # else: - # raise + while True: + try: + # "C" state means the job is completed, no need to wait for it + ret = subprocess.check_output("squeue | grep -v \"C debug\" | grep -v \"JOBID\" || true", + shell=True) + if not len(ret): + break + time.sleep(3) + except subprocess.CalledProcessError as inst: + if inst.returncode == 153: # queue is empty + break + else: + raise time.sleep(10) -- GitLab