You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today is 2011-12-01. I have a task with next date set, say, to 2011-12-01 00:00:00.
When cron job runs at 01:00, next run time is set to something like 2012-01-01 01:00:30 (seconds depend on cron job run time). Then, because you are comparing next run date to today's date only (without time), next time this task actually runs is 2012-01-02, and next run time would be set to 2012-02-02 01:00:30 and so on.
The simple solution would be to do: task.next_run_date = interval.send(units.downcase).from_now.to_date
in scheduled_tasks_checker.rb, converting DateTime to Date, so next run time for today's task would be set to 2012-01-01 00:00:00.
The text was updated successfully, but these errors were encountered:
Today is 2011-12-01. I have a task with next date set, say, to 2011-12-01 00:00:00.
When cron job runs at 01:00, next run time is set to something like 2012-01-01 01:00:30 (seconds depend on cron job run time). Then, because you are comparing next run date to today's date only (without time), next time this task actually runs is 2012-01-02, and next run time would be set to 2012-02-02 01:00:30 and so on.
The simple solution would be to do:
task.next_run_date = interval.send(units.downcase).from_now.to_date
in scheduled_tasks_checker.rb, converting DateTime to Date, so next run time for today's task would be set to 2012-01-01 00:00:00.
The text was updated successfully, but these errors were encountered: