Skip to content

Commit

Permalink
reg: job id is in rq kwargs dict
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 26, 2024
1 parent 0aaf186 commit 815eac2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dcor_shared/rqjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ def enqueue_job(self, resource: Dict, redis_connect=None):
redis_connect = ckan_redis_connect()

jid = f"{resource['package_id']}_{resource['position']}_"
jid_cur = jid + self.name
rq_args = {
"timeout": self.timeout,
"at_front": self.at_front,
"job_id": jid_cur,
}
if self.depends_on:
rq_args["depends_on"] = [f"{jid}_{dep}" for dep in self.depends_on]

jid_cur = jid + self.name

if not Job.exists(jid_cur, connection=redis_connect):
toolkit.enqueue_job(jid_cur,
self.method,
toolkit.enqueue_job(self.method,
[resource],
title=self.title,
queue=self.queue,
Expand Down

0 comments on commit 815eac2

Please sign in to comment.