Open munzzz5 opened 2 years ago
I'm facing the same issue. My workaround is to filter jobs by the queue_name stored in the origin property. Here's how it would work using @munzzz5 example:
scheduler = Scheduler("systemTriggers",connection=Redis())
allJobs=scheduler.get_jobs()
for job in allJobs:
if job.origin == "systemTriggers": # check that the job is from the desired queue
scheduler.cancel(job)
scheduler.scheduler(newJob)
I am trying to schedule the main jobs in the default queue, But secondary jobs in another queue called "systemTriggers". The Job is scheduled in the second queue. when i cancel jobs in "systemTriggers" all jobs of default queue are also cancelled.
Here is how im doing this:
Thanks!