question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

【Bug】schedule.scheduleJob executed twice

See original GitHub issue

AWS Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-116-generic x86_64) node: v8.11.1 node-schedule: 1.2.4

my code:

// Everyday 0:00, generater new tasks
const rule = new schedule.RecurrenceRule();
rule.hour = 0;
rule.minute = 0;
rule.second = 0;
schedule.scheduleJob(rule, () => {
  console.log('Recurrence job start');
  getTaskRules();
});

my log: image image image Previous log is ok too! image server no restart, no error: image

I have encountered this problem a few months ago, I just restarted the server, it works fine! but now,it is coming again!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
linkFly6commented, Jan 19, 2020

If you used PM2, because PM2 is used to start two processes。

image

1reaction
HuMorancommented, May 31, 2019

I update to 1.3.0 and it had worked fine for a few months.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sometime execute scheduled job twice, - bug?
A scheduled background job is to execute twice. Not sure why this is happening. Schedule Job Code -> var res = BackgroundJob.
Read more >
Data Services Schedules are getting executed twice at run time
Issue: Data Services Schedules are getting executed twice at run time. How to reproduce the issue: 1) Create a Job Schedule from DS...
Read more >
Node schedule runs task too many times - Stack Overflow
To build that, I used the node-schedule package. I specified it that every day at 16:00 it should execute a function: schedule.scheduleJob("* * ......
Read more >
How to schedule a job twice a day with different minutes?
To schedule two jobs, use two scheduling statements: System.schedule('4AM RUN', '0 0 4 ? * *', new AccessScheduler()); System.schedule('4AM ...
Read more >
Scheduled task runs twice, bug in task scheduler - TechNet
Now I've encountered a very strange problem which I believe is a bug. Sometimes the task will be run twice. This is clearly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found