Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next run date is calculated improperly #5

Open
shadowpanther opened this issue Dec 1, 2011 · 2 comments
Open

Next run date is calculated improperly #5

shadowpanther opened this issue Dec 1, 2011 · 2 comments

Comments

@shadowpanther
Copy link

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.

@myneid
Copy link
Owner

myneid commented Aug 15, 2012

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

@Wolfer
Copy link

Wolfer commented Jan 22, 2015

I make pull request #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants