Run Now… Sometimes does, sometimes doesn’t
-
Morning John,
Our sites’ are configured the same in terms of WP_DISABLE_CRON = True and all have a cronjob set in cPanel (or host equivalent) to trigger wp_cron either via WP_CLI or direct scheduled at least twice an hour, but frequently per minute. The system cron schedule is only important to illustrate that the shortest frequency between wp_cron execution is 1 minute.
What I experience,
On some sites selecting Run Now on a scheduled task in WP Crontrol appears to trigger the job immediately – as in at whatever second it is past the minute, say 12:45:23 – which is what I’m expecting. When the page refreshes, it has begun running.
Whereas, on other sites, Run now creates a backdated version of the scheduled task, on the page refresh it then appears top of the queue and the system waits until system cron triggers the wp_cron action.I’ve been having this issue across our sites since I’ve started working with WP that has WP Crontrol and I just can’t seem to narrow down if there’s a setting or configuration I’m missing.
I initially thought that it must be that the site still is running wp_cron by page visit/refresh. But on each I have confirmed that DISABLE_WP_CRON is true in wp_config.php.
I notice in Viewing error output when using “Run Now” you state
Thanks for the report. I’ve tried very hard to ensure that when you use “Run Now” in WP Crontrol that it runs the event in the same manner as it runs when scheduled normally (some other cron management plugins simply call the action for the event which means the context for the request is incorrect). What happens behind the scenes is it schedules an event in the past and then immediately spawns the cron event runner.
which is what I expect to happen.
Are you able to shed any light on why some of the sites just create the queued job and wait for system cron?
Cheers
- The topic ‘Run Now… Sometimes does, sometimes doesn’t’ is closed to new replies.