cancelNext not working
See original GitHub issueAttempting to use the cancelNext feature on a reoccurring job, however, it doesn’t appear to be cancelling the next invocation. Whether I call j.cancelNext() or j.cancelNext(true) nothing happens. By calling j.cancelNext(false) the entire job stops indefinitely.
var rule = new schedule.RecurrenceRule();
rule.second = [new schedule.Range(0, 59)];
var j = schedule.scheduleJob(rule, function(){
console.log(`Job j ran at: ${new Date()}`);
});
setTimeout(function(){
console.log('Next invocation without cancellation should be at', j.nextInvocation());
j.cancelNext(true);
}, 3000);
Output:
Job j ran at: Sat Feb 24 2018 14:25:38 GMT-0800 (PST)
Job j ran at: Sat Feb 24 2018 14:25:39 GMT-0800 (PST)
Job j ran at: Sat Feb 24 2018 14:25:40 GMT-0800 (PST)
Next invocation without cancellation should be at 2018-02-24T22:25:41.000Z
Job j ran at: Sat Feb 24 2018 14:25:41 GMT-0800 (PST)
Job j ran at: Sat Feb 24 2018 14:25:42 GMT-0800 (PST)
Job j ran at: Sat Feb 24 2018 14:25:43 GMT-0800 (PST)
Job j ran at: Sat Feb 24 2018 14:25:44 GMT-0800 (PST)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Route cancellation · Issue #2476 · vercel/next.js - GitHub
Working on a editor app and need to be able to cancel route changes in case there are unsaved changes. I just ended...
Read more >Unable to cancel next up upgrade - Community forums - AT&T
There are two steps. You have to cancel the program from your installment plan and then you have to call them to get...
Read more >How to cancel next event calls? - javascript - Stack Overflow
I have an event "pointerdown" but I want it to cancel the event call when a certain condition is met in one of...
Read more >Cancel Change UI Action not working - ServiceNow Community
Solved: Hello Experts, For some reason OOTB Cancel Change UI Action button is not working when clicked on it opens a dialog box...
Read more >Cancel on next payment - WordPress.org
When I subscribe with a testing user to one of my subscriptions and then cancel the subscription afterwards, the user is not listed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi
Not to sound needy but if everything is ok can we get this merged? I’m going to be using this lib and need this functionality
Perfect, thanks for the fix!