Commit 02450a13 by Guba Sándor

storage: added priority parameters for tasks

parent 59f2221c
...@@ -3,14 +3,16 @@ from celery.contrib.abortable import AbortableTask ...@@ -3,14 +3,16 @@ from celery.contrib.abortable import AbortableTask
@celery.task @celery.task
def check_queue(storage, queue_id): def check_queue(storage, queue_id, priority):
''' Celery inspect job to check for active workers at queue_id ''' Celery inspect job to check for active workers at queue_id
return True/False return True/False
''' '''
drivers = ['storage', 'download']
worker_list = [storage + "." + d for d in drivers]
queue_name = storage + "." + queue_id queue_name = storage + "." + queue_id
active_queues = celery.control.inspect(worker_list).active_queues() if priority is not None:
queue_name = queue_name + "." + priority
inspect = celery.control.inspect()
inspect.timeout = 0.1
active_queues = inspect.active_queues()
if active_queues is None: if active_queues is None:
return False return False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment