|
|
@ -167,8 +167,8 @@ class Queue(object):
|
|
|
|
connection.rpush(self.key, job_id)
|
|
|
|
connection.rpush(self.key, job_id)
|
|
|
|
|
|
|
|
|
|
|
|
def enqueue_call(self, func, args=None, kwargs=None, timeout=None,
|
|
|
|
def enqueue_call(self, func, args=None, kwargs=None, timeout=None,
|
|
|
|
result_ttl=None, description=None, depends_on=None,
|
|
|
|
result_ttl=None, job_ttl=None, description=None,
|
|
|
|
job_id=None):
|
|
|
|
depends_on=None, job_id=None):
|
|
|
|
"""Creates a job to represent the delayed function call and enqueues
|
|
|
|
"""Creates a job to represent the delayed function call and enqueues
|
|
|
|
it.
|
|
|
|
it.
|
|
|
|
|
|
|
|
|
|
|
@ -180,7 +180,7 @@ class Queue(object):
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: job with dependency shouldn't have "queued" as status
|
|
|
|
# TODO: job with dependency shouldn't have "queued" as status
|
|
|
|
job = self.job_class.create(func, args, kwargs, connection=self.connection,
|
|
|
|
job = self.job_class.create(func, args, kwargs, connection=self.connection,
|
|
|
|
result_ttl=result_ttl, status=Status.QUEUED,
|
|
|
|
result_ttl=result_ttl, job_ttl=job_ttl, status=Status.QUEUED,
|
|
|
|
description=description, depends_on=depends_on, timeout=timeout,
|
|
|
|
description=description, depends_on=depends_on, timeout=timeout,
|
|
|
|
id=job_id)
|
|
|
|
id=job_id)
|
|
|
|
|
|
|
|
|
|
|
@ -229,6 +229,7 @@ class Queue(object):
|
|
|
|
timeout = kwargs.pop('timeout', None)
|
|
|
|
timeout = kwargs.pop('timeout', None)
|
|
|
|
description = kwargs.pop('description', None)
|
|
|
|
description = kwargs.pop('description', None)
|
|
|
|
result_ttl = kwargs.pop('result_ttl', None)
|
|
|
|
result_ttl = kwargs.pop('result_ttl', None)
|
|
|
|
|
|
|
|
job_ttl = kwargs.pop('job_ttl', None)
|
|
|
|
depends_on = kwargs.pop('depends_on', None)
|
|
|
|
depends_on = kwargs.pop('depends_on', None)
|
|
|
|
job_id = kwargs.pop('job_id', None)
|
|
|
|
job_id = kwargs.pop('job_id', None)
|
|
|
|
|
|
|
|
|
|
|
@ -238,7 +239,7 @@ class Queue(object):
|
|
|
|
kwargs = kwargs.pop('kwargs', None)
|
|
|
|
kwargs = kwargs.pop('kwargs', None)
|
|
|
|
|
|
|
|
|
|
|
|
return self.enqueue_call(func=f, args=args, kwargs=kwargs,
|
|
|
|
return self.enqueue_call(func=f, args=args, kwargs=kwargs,
|
|
|
|
timeout=timeout, result_ttl=result_ttl,
|
|
|
|
timeout=timeout, result_ttl=result_ttl, job_ttl=job_ttl,
|
|
|
|
description=description, depends_on=depends_on,
|
|
|
|
description=description, depends_on=depends_on,
|
|
|
|
job_id=job_id)
|
|
|
|
job_id=job_id)
|
|
|
|
|
|
|
|
|
|
|
|