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.

job runs multiple times every minute with reschedule

See original GitHub issue
const schedule = require('node-schedule');

const cron = '*/1 * * * *';
const job = new schedule.Job('test', function () {
	console.info('job ' + job.name + ' running at ' + new Date().toLocaleString());
	job.reschedule(cron);
});

job.schedule(cron);

job runs hundred times with this code. job.reschedule() function fires the job runs wrongly.

but if changed the code const cron = '*/15 * * * * *';, it’s just runs once, jos.rescheduled() functoin works fine.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ivanm376commented, Aug 17, 2018

@mariohmol it runs every second in this case, change

‘* */1 * * * *’

to

‘0 */1 * * * *’

0reactions
mariohmolcommented, Aug 17, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Agenda Job: now() make the job running multiple times
The above works as expected i.e. it runs the job every 5 minutes. But I don't want a recurring job. Rather run it...
Read more >
How to run a scheduled job every 1 minute , and automatically ...
It is not possible. Scheduled classes are queued, and sometimes they can take longer than a minute to run. This means that your...
Read more >
Schedule job multiple times within time range - TechDocs
Use REXX to schedule a job to run multiple times within a set time range. ... Within the application, a UNIX job needs...
Read more >
Change Default Pipeline Schedule Worker interval to look for ...
From now on, my scheduled jobs can run every 15 minutes, which seems to me like a good tradeoff compared to every minute...
Read more >
Cron Job: A Comprehensive Guide for Beginners 2023
Cron jobs can't be distributed to multiple computers on a network. ... If a task fails, it won't run again until the next...
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