thieman / dagobah

Simple DAG-based job scheduler in Python
Do What The F*ck You Want To Public License
755 stars 160 forks source link

Crontab format not correct #46

Open extrinsicmedia opened 10 years ago

extrinsicmedia commented 10 years ago

The 'Cron Schedule String' entry: 00 22 * * *

is evaluating 'Next Scheduled Run' as: January 31 2014 2:00 PM

but I think this should be: January 30 2014 11:00 PM

thieman commented 10 years ago

@extrinsicmedia The Cron entry gets interpreted as a local time on the server running Dagobah. The frontend then takes the UTC representation of that time and shows it to you in your browser's timezone. My guess is that your server and your browser are about half a world away from each other. Am I close?

extrinsicmedia commented 10 years ago

@thieman I'm testing locally so they're both on the same machine. Possible that the Cron entry is getting interpreted from UTC 0?

thieman commented 10 years ago

Hmm, yeah maybe something is getting converted where it shouldn't. I testing servers running UTC, so it'd make sense if I missed something. Will check it out, thanks.

thieman commented 10 years ago
  1. The server is asserting that the Cron time is based on UTC. This needs to instead use the server's local time.
  2. When the server passes datetimes to the frontend, they do not have TZ information. The frontend assumes that everything is in UTC. The backend should convert its datetimes to UTC before sending them to the frontend.
  3. I don't think the frontend ever sends datetimes to the backend (it only sends Cron strings), so we don't have to juggle authoritative timezones between the client and server. Hooray.
thieman commented 10 years ago

I think I wrote a fix for this like two months ago. I'll actually get off my ass and try to merge it this weekend.

gardinerd commented 10 years ago

I ran into this issue as well while running on a server set to EDT. Happy to help test this out further.

thieman commented 10 years ago

@creator11 This is my work-in-progress branch if you'd like to give it a go: https://github.com/thieman/dagobah/tree/tnt-fix-cron-format

Thanks for the assist!

gardinerd commented 10 years ago

Thanks I'll give it a go through a QA regression.

gardinerd commented 10 years ago

@thieman pull down the new branch and built. However after building and running the branch it appears you cannot create new jobs. Using the SQLiteImpl

thieman commented 10 years ago

Well, that's certainly interesting. Will take another pass this weekend, thanks.