HomeSoftware Heritage

grab_next_visits: avoid time interval calculations in PostgreSQL

Description

grab_next_visits: avoid time interval calculations in PostgreSQL

When the database is in a non-UTC timezone with DST, and a `timestamptz

  • interval` calculation crosses a DST change, the result of the

calculation can be one hour off from the expected value:

PostgreSQL will vary the timestamp by the amount of days in the
interval, and will keep the same (local) time, which will be offset by
an hour because of the DST change.

Doing the datetime +- timedelta calculations in Python instead of
PostgreSQL avoids this caveat altogether.

Details

Provenance
olasdAuthored on Oct 27 2021, 3:45 PM
olasdPushed on Oct 27 2021, 4:04 PM
Differential Revision
D6563: grab_next_visits: avoid time interval calculations in PostgreSQL
Parents
rDSCHecc0e2803e0b: Restrict the click version to avoid conflict version with celery's
Branches
Unknown
Tags
Unknown
Build Status
Buildable 24739
Build 38615: test-and-buildJenkins console · Jenkins