Skip to content
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

Fix the bug that canceled job still keeps running #379

Closed
wants to merge 1 commit into from

Conversation

wux5
Copy link
Contributor

@wux5 wux5 commented Sep 1, 2017

Fixes #369

@wux5
Copy link
Contributor Author

wux5 commented Sep 1, 2017

If you want to test the fix, you can easily reproduce the issue with this code, and verify it works with the new version.

var nscheduler = require('node-schedule');

var schedName = 'test-sched';
var job = nscheduler.scheduleJob(schedName, '*/1 * * * * *', function () {
  var time1 = Date.now();
  console.log(time1, schedName + ' ran successfully');
  while (Date.now() - time1 < 2000) {
    // 
  }
});

setTimeout(function () {
  job.cancel();
}, 2100);

Or you can also test it with @nnoto 's more complex test case in #369

@rostislavprovodenko
Copy link

When is it planned to be merged?

@santigimeno
Copy link
Member

When time permits :)

santigimeno added a commit to santigimeno/node-schedule that referenced this pull request Sep 18, 2017
@santigimeno
Copy link
Member

Landed in 9f68aa0 with a test added in f9cc2c8. Thanks a lot @wux5 !

@santigimeno
Copy link
Member

Published in 1.2.5

@nirajtathe
Copy link

nirajtathe commented Nov 27, 2017

I am also facing the same issue. I have created 2 jobs with different names and execution time. But it is only executing the second job at 1st job execution time and 2nd as well. I have also downloaded 1.2.0 version but still facing the same problem. I have saved the job object and printed, it is showing correct job name (job name which I had assigned). I am unable to find any solution and move ahead.
Can anyone help me?

@santigimeno
Copy link
Member

Sure. Can you open a new issue explaining the problem with code that reproduces it?

@nirajtathe
Copy link

@santigimeno I have created new issue #398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants