From f0a3dd262e819603226006d40f1ddcd9fd534a20 Mon Sep 17 00:00:00 2001 From: Sylvain Zimmer Date: Mon, 20 Jan 2014 11:41:15 -0800 Subject: [PATCH] Added connection argument to get_current_job() --- rq/job.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rq/job.py b/rq/job.py index 8d6b9fc..a705873 100644 --- a/rq/job.py +++ b/rq/job.py @@ -56,14 +56,14 @@ def requeue_job(job_id, connection=None): fq.requeue(job_id) -def get_current_job(): +def get_current_job(connection=None): """Returns the Job instance that is currently being executed. If this function is invoked from outside a job context, None is returned. """ job_id = _job_stack.top if job_id is None: return None - return Job.fetch(job_id) + return Job.fetch(job_id, connection=connection) class Job(object):