Skip to content
This repository was archived by the owner on Jun 5, 2023. It is now read-only.

UTC datetime #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

UTC datetime #70

wants to merge 2 commits into from

Conversation

duxiaoyao
Copy link

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()

…amp for scheduling; work with naive UTC datetimes internally; convert datetimes to naive UTC right after received from external(ResQ.enqueue_at).
@binarymatt
Copy link
Owner

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.

@shreyansb
Copy link

It would be awesome if this was merged in - UTC everything would be sweet.

@shreyansb
Copy link

Thanks!

@binarymatt
Copy link
Owner

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.

@binarymatt binarymatt added the 2.0 label Apr 12, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants