Skip to content

Commit 4eeab0e

Browse files
committed
archive: Set publish time a bit in the past to accomodate desynced clients
1 parent 030b4d8 commit 4eeab0e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lkarchive/publish.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,11 @@ def _publish_suite_dists(
823823
set_deb822_value(entry, 'Version', rss.suite.version)
824824
set_deb822_value(entry, 'Codename', suite_codename)
825825
set_deb822_value(entry, 'Label', suite_label)
826-
entry['Date'] = datetime_to_rfc2822_string(datetime.utcnow())
826+
827+
# we set the date to 2 minutes in the past to guard against clock sync issue when updating
828+
# rapidly and some clients are a bit behind the master clock (which should not happen, but
829+
# sometimes does)
830+
entry['Date'] = datetime_to_rfc2822_string(datetime.utcnow() - timedelta(minutes=2))
827831
if not rss.frozen and not only_sources:
828832
entry['Valid-Until'] = datetime_to_rfc2822_string(datetime.utcnow() + timedelta(days=8))
829833
entry['Acquire-By-Hash'] = 'yes'

0 commit comments

Comments
 (0)