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

The chosen event occurred in the past #25

Closed
acejacek opened this issue Dec 23, 2020 · 1 comment
Closed

The chosen event occurred in the past #25

acejacek opened this issue Dec 23, 2020 · 1 comment

Comments

@acejacek
Copy link

I have lots of problems to schedule the cron job correctly. All the time I get message:

Runtime error: The chosen event occurred in the past; cannot wait a negative amount of time.

Which is funny, because I trigger event at 02:00, and sunrise is 08:51:11
Same goes for sunset: job scheduled at 12:00, sunset at 14:55.

Apparently, there are some problems when date is today.

I think it's obvious, if I wait for sunrise (without specific --date), I mean the next coming sunrise tomorrow morning. I can't process why this program assumes I care about sunrise which already happened today morning. Maybe some sort of --force flag will do?

@mfreeborn
Copy link
Owner

Thank you @acejacek - I'm not sure I agree that it's obvious --date refers to the next time the event occurs. There are too many edge cases, in my opinion, and I don't like to make assumptions about people's use cases.

The simplest and least degree of assumption is for --date to be "today" if it is not explicitly mentioned. If you want to schedule it for a specific day, it couldn't be simpler to pass that to the --date parameter. In fact, even allowing the user to skip the --date parameter at all is a luxury; it would be most clear to have it as a required option.

I'll close this because I don't see any problem with the current implementation.

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

2 participants