pyres
pyres copied to clipboard
UTC datetime
Two bugs with local datetimes:
- ResQ.enqueue_at: it does not work as expected when you pass a datetime which is not in the local timezone.
- Job.retry: retry_at & retry_until within the overlapped 1 hour caused by DST adjustment.
There were discussions on the thread "move pyres times from local timezone to UTC" in the mailing list.
Changes did:
- datetimes from external are converted to UTC in time
- ResQ.enqueue_at: expects UTC datetime, it will be converted to UTC if it's an aware datetime
- keep using timestamp for scheduling
- use UTC datetimes for consistency, use datetime.utcnow() instead of datetime.now(), use datetime.utcfromtimestamp() instead of datetime.fromtimestamp()
sorry i haven't done anything with this yet. I've been moving houses recently and haven't had time to review. Hopefully I will get time this week.
It would be awesome if this was merged in - UTC everything would be sweet.
Thanks!
i'm hoping to sit down and figure out how I can apply this change to the current codebase cleanly. If I have to, i'll pull in bits and pieces.