Skip to content

Commit

Permalink
archive: Set publish time a bit in the past to accomodate desynced cl…
Browse files Browse the repository at this point in the history
…ients
  • Loading branch information
ximion committed May 6, 2024
1 parent 030b4d8 commit 4eeab0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lkarchive/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,11 @@ def _publish_suite_dists(
set_deb822_value(entry, 'Version', rss.suite.version)
set_deb822_value(entry, 'Codename', suite_codename)
set_deb822_value(entry, 'Label', suite_label)
entry['Date'] = datetime_to_rfc2822_string(datetime.utcnow())

# we set the date to 2 minutes in the past to guard against clock sync issue when updating
# rapidly and some clients are a bit behind the master clock (which should not happen, but
# sometimes does)
entry['Date'] = datetime_to_rfc2822_string(datetime.utcnow() - timedelta(minutes=2))
if not rss.frozen and not only_sources:
entry['Valid-Until'] = datetime_to_rfc2822_string(datetime.utcnow() + timedelta(days=8))
entry['Acquire-By-Hash'] = 'yes'
Expand Down

0 comments on commit 4eeab0e

Please sign in to comment.