-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete non unique repeating jobs? #103
Comments
@piggydoughnut May you please share a scenario for the above. |
Scenario I have a project. I would like to remind people every month about how awesome my project is. But I only want these reminders to run until the end of the project. So I was imagining I will create repeated notifications and once the precondition is not satisfied ( today > project.endDate ) then I will remove the recurring event. This is a simplification of what I got Job scheduler
Worker
So some of the jobs repeat as I got in the Scheduler. But if I just create non_unique jobs, so with each repeat a new job is created, I do not know how to stop them. I had a little incident today, with jobs running every 5 second and I didn't know how to stop the actual recurring event programatically. I hope this clarifies and provides you with enough information 😸 Thx 👽 |
But is there any way to stop the unique job as well ? (Each and every time I remove the job from redis a new job gets posted). So I do not know how to stop the recurring the jobs (either unique or non-unique). Is there any way to stop the recurring jobs ? |
Each unique job has a name. In order to stop it you gotta remove it by its name. To stop unique and recurring jobs you gotta use the following:
|
Queue.remove doesn't work for me. `function scheduleTask (data, done) { /** ************ Workers **************************/ queue.process('scheduleTask', 1, function (job, done) { |
Hello, Any updates regarding the initial post issue? Thank you |
Hello,
I am a bit confused over here. I understand how to schedule repeating jobs with Queue.every('2 seconds', job); But I don't understand how to stop non unique repeating jobs? Let's say I want a job to run every month until some precondition fails. So my worker takes the job, checks precondition and if the precondition fails then the worker stops the repetition of that job.
Thank you in advance for any advice.
The text was updated successfully, but these errors were encountered: