Don't crash when upgrading a fresh database

This commit is contained in:
Emi Simpson 2022-11-28 16:20:43 -05:00
parent 39d24e56c3
commit 64ddfdb702
No known key found for this signature in database
GPG key ID: 45E9C6E81BD86E7C

View file

@ -61,7 +61,10 @@ def upgrade():
# List of file hashes which have not expired yet
# This could get really big for some servers
unexpired_files = set(os.listdir(storage))
try:
unexpired_files = set(os.listdir(storage))
except FileNotFoundError:
return # There are no currently unexpired files
# Calculate an expiration date for all existing files
files = session.scalars(