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.

`immediateStart` doesn't actually start the cron job.

See original GitHub issue

When immediateStart !== false, the module will execute task.update(new Date()) source. But the update function first checks if the time has come to execute the task. However, the time hasn’t come because cron job is schedule to be run, say, at midnight.

The immediateStart functionality should actually execute the task immediately, not check immediately if the time has come. The current functionality just starts the timer of the cron job. I think this should be documented properly or be changed.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kadishmalcommented, Oct 12, 2016

It should probably be renamed as immediatelyCheck and documented accordingly.

0reactions
SassNinjacommented, Apr 20, 2018

The type of functionality you guys are looking for would be a param with a name like “executeJobOnceOnStart” or something like that. That functionality doesn’t exist but you can just do it yourself by calling the job function once directly.

Thanks for this hint! Anyway immediateStart should be renamed as its name is definitely confusing (that’s what brought me here).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running a cron job manually and immediately - Server Fault
Here's what I did, and it seems to work in this situation. At least, it shows me an error, whereas running from the...
Read more >
linux - CronJob not running - Stack Overflow
My cronjob doesn't run?! ... Run ps ax | grep cron and look for cron. Debian: service cron start or service cron restart....
Read more >
Cron job troubleshooting guide - Cronitor
Check that your cron job is running by finding the attempted execution in syslog · Begin by grepping for the command in /var/log/syslog...
Read more >
Top Reasons Your Cron Job Isn't Running - Airplane.dev
This article walks through the most common reasons why your cron job may not be working as expected: schedule errors, environmental changes, ...
Read more >
how can I make cron run a job right now, for testing/debugging ...
You can force the crontab to run with following command: run-parts /etc/cron.daily.
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