|
|
@ -232,13 +232,17 @@ class Queue(object):
|
|
|
|
job = self.enqueue_job(job, at_front=at_front)
|
|
|
|
job = self.enqueue_job(job, at_front=at_front)
|
|
|
|
|
|
|
|
|
|
|
|
if not self._async:
|
|
|
|
if not self._async:
|
|
|
|
job.perform()
|
|
|
|
job = self.run_job(job)
|
|
|
|
job.set_status(JobStatus.FINISHED)
|
|
|
|
|
|
|
|
job.save(include_meta=False)
|
|
|
|
|
|
|
|
job.cleanup(DEFAULT_RESULT_TTL)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return job
|
|
|
|
return job
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run_job(self, job):
|
|
|
|
|
|
|
|
job.perform()
|
|
|
|
|
|
|
|
job.set_status(JobStatus.FINISHED)
|
|
|
|
|
|
|
|
job.save(include_meta=False)
|
|
|
|
|
|
|
|
job.cleanup(DEFAULT_RESULT_TTL)
|
|
|
|
|
|
|
|
return job
|
|
|
|
|
|
|
|
|
|
|
|
def enqueue(self, f, *args, **kwargs):
|
|
|
|
def enqueue(self, f, *args, **kwargs):
|
|
|
|
"""Creates a job to represent the delayed function call and enqueues
|
|
|
|
"""Creates a job to represent the delayed function call and enqueues
|
|
|
|
it.
|
|
|
|
it.
|
|
|
|