Loading autocnet/io/db/redis_queue.py +9 −1 Original line number Diff line number Diff line import json import time import warnings import numpy as np Loading Loading @@ -27,8 +28,15 @@ def pop_computetime_push(queue, inqueue, outqueue): msg : dict The message from the processing queue. """ # Check if the redis queue is empty msg = queue.rpop(inqueue) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() # Load the message out of the processing queue and add a max processing time key msg = json.loads(queue.rpop(inqueue), object_hook=object_hook) msg = json.loads(msg, object_hook=object_hook) msg['max_time'] = time.time() + slurm_walltime_to_seconds(msg['walltime']) # Push the message to the processing queue with the updated max_time Loading Loading
autocnet/io/db/redis_queue.py +9 −1 Original line number Diff line number Diff line import json import time import warnings import numpy as np Loading Loading @@ -27,8 +28,15 @@ def pop_computetime_push(queue, inqueue, outqueue): msg : dict The message from the processing queue. """ # Check if the redis queue is empty msg = queue.rpop(inqueue) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() # Load the message out of the processing queue and add a max processing time key msg = json.loads(queue.rpop(inqueue), object_hook=object_hook) msg = json.loads(msg, object_hook=object_hook) msg['max_time'] = time.time() + slurm_walltime_to_seconds(msg['walltime']) # Push the message to the processing queue with the updated max_time Loading