Redmine-Periodic-Task icon indicating copy to clipboard operation
Redmine-Periodic-Task copied to clipboard

Next run date is calculated improperly

Open shadowpanther opened this issue 13 years ago • 2 comments

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.

shadowpanther avatar Dec 01 '11 13:12 shadowpanther

fork it and make a pull request i will review it and merge it

myneid avatar Aug 15 '12 18:08 myneid

I make pull request #17

Wolfer avatar Jan 22 '15 08:01 Wolfer