Loading autocnet/io/db/redis_queue.py +8 −2 Original line number Diff line number Diff line Loading @@ -27,8 +27,14 @@ def pop_computetime_push(queue, inqueue, outqueue): msg : dict The message from the processing queue. """ # 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) # Check if the redis queue is empty msg = queue.rpop(inqueue) if msg is None: return msg # if msg is not empty, Load the message out of the processing queue and add a max processing time key 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 bin/acn_load_images +4 −0 Original line number Diff line number Diff line Loading @@ -123,4 +123,8 @@ if __name__ == '__main__': msg = pop_computetime_push(queue, conf['processing_queue'], conf['working_queue']) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() main(msg, config) bin/acn_overlaps +4 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import copy import os import json import sys import warnings from redis import StrictRedis import yaml Loading Loading @@ -50,5 +51,8 @@ if __name__ == '__main__': msg = pop_computetime_push(queue, conf['processing_queue'], conf['working_queue']) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() main(msg, config) bin/acn_submit +4 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import copy import os import json import sys import warnings from redis import StrictRedis import yaml Loading Loading @@ -57,7 +58,9 @@ if __name__ == '__main__': msg = pop_computetime_push(queue, conf['processing_queue'], conf['working_queue']) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() # In order to pop an entry off the queue, we need the exact contents #remove_key = copy.deepcopy(msg) Loading bin/acn_subpixel +4 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import copy import os import json import sys import warnings from redis import StrictRedis import yaml Loading Loading @@ -47,5 +48,8 @@ if __name__ == '__main__': msg = pop_computetime_push(queue, conf['processing_queue'], conf['working_queue']) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() main(msg, config) Loading
autocnet/io/db/redis_queue.py +8 −2 Original line number Diff line number Diff line Loading @@ -27,8 +27,14 @@ def pop_computetime_push(queue, inqueue, outqueue): msg : dict The message from the processing queue. """ # 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) # Check if the redis queue is empty msg = queue.rpop(inqueue) if msg is None: return msg # if msg is not empty, Load the message out of the processing queue and add a max processing time key 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
bin/acn_load_images +4 −0 Original line number Diff line number Diff line Loading @@ -123,4 +123,8 @@ if __name__ == '__main__': msg = pop_computetime_push(queue, conf['processing_queue'], conf['working_queue']) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() main(msg, config)
bin/acn_overlaps +4 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import copy import os import json import sys import warnings from redis import StrictRedis import yaml Loading Loading @@ -50,5 +51,8 @@ if __name__ == '__main__': msg = pop_computetime_push(queue, conf['processing_queue'], conf['working_queue']) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() main(msg, config)
bin/acn_submit +4 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import copy import os import json import sys import warnings from redis import StrictRedis import yaml Loading Loading @@ -57,7 +58,9 @@ if __name__ == '__main__': msg = pop_computetime_push(queue, conf['processing_queue'], conf['working_queue']) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() # In order to pop an entry off the queue, we need the exact contents #remove_key = copy.deepcopy(msg) Loading
bin/acn_subpixel +4 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import copy import os import json import sys import warnings from redis import StrictRedis import yaml Loading Loading @@ -47,5 +48,8 @@ if __name__ == '__main__': msg = pop_computetime_push(queue, conf['processing_queue'], conf['working_queue']) if msg is None: warnings.warn('Expected to process a cluster job, but the message queue is empty.') sys.exit() main(msg, config)