Always save previews in UTC offset (#11629)

This commit is contained in:
Nicolas Mowen 2024-05-29 14:55:56 -06:00 committed by GitHub
parent 37dd3fc25b
commit 9fc22efa2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,6 +180,7 @@ class PreviewRecorder:
# end segment at end of hour # end segment at end of hour
self.segment_end = ( self.segment_end = (
(datetime.datetime.now() + datetime.timedelta(hours=1)) (datetime.datetime.now() + datetime.timedelta(hours=1))
.astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0) .replace(minute=0, second=0, microsecond=0)
.timestamp() .timestamp()
) )
@ -192,6 +193,7 @@ class PreviewRecorder:
# check for existing items in cache # check for existing items in cache
start_ts = ( start_ts = (
datetime.datetime.now() datetime.datetime.now()
.astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0) .replace(minute=0, second=0, microsecond=0)
.timestamp() .timestamp()
) )
@ -300,6 +302,7 @@ class PreviewRecorder:
# reset frame cache # reset frame cache
self.segment_end = ( self.segment_end = (
(datetime.datetime.now() + datetime.timedelta(hours=1)) (datetime.datetime.now() + datetime.timedelta(hours=1))
.astimezone(datetime.timezone.utc)
.replace(minute=0, second=0, microsecond=0) .replace(minute=0, second=0, microsecond=0)
.timestamp() .timestamp()
) )