diff --git a/gga_load_data.py b/gga_load_data.py index f240f62ae763a7799db68ca01598aa541f1517e7..8ff4a82c4a3fd14aeae97e89a8c9023766c26966 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)