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
1 changed files with 4 additions and 1 deletions

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(