Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nix-channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# be too old and defunct.
#
# [1]: https://discourse.nixos.org/t/announcement-moving-nixos-org-to-netlify/6212
CLONE_SINCE = datetime.now() - timedelta(days=CLONE_SINCE_DAYS)
CLONE_SINCE = datetime.now(pytz.utc) - timedelta(days=CLONE_SINCE_DAYS)
TIMEOUT = 60

working_dir = Path(WORKING_DIR)
Expand Down Expand Up @@ -378,7 +378,7 @@ def parse_narinfo(narinfo):
def garbage_collect():
logging.info(f'- Collecting garbage')

time_threshold = datetime.now() - timedelta(days=RETAIN_DAYS)
time_threshold = datetime.now(pytz.utc) - timedelta(days=RETAIN_DAYS)

last_updated = {}
latest = {}
Expand All @@ -393,7 +393,7 @@ def garbage_collect():
date_match = re.match(r'\d+-\d+-\d+ \d+:\d+:\d+', date_str)
assert date_match is not None, f'Release {release!r} has invalid time {date_str!r}'
date_str = date_match[0]
released_date = datetime.strptime(date_str, '%Y-%m-%d %H:%M:%S')
released_date = datetime.strptime(date_str, '%Y-%m-%d %H:%M:%S').replace(tzinfo=pytz.utc)

# Very old channel version, ignore for GC
if released_date < CLONE_SINCE:
Expand Down
Loading