do not fail if local db doesn't exist
Browse files
backend/src/app_factory.py
CHANGED
@@ -83,7 +83,10 @@ async def _database_lifespan(app: FastAPI):
|
|
83 |
# If backup is enabled but no backup is found, delete local database to prevent confusion.
|
84 |
print("Couldn't find backup in remote dataset.")
|
85 |
print("Deleting local database for a fresh start.")
|
86 |
-
|
|
|
|
|
|
|
87 |
|
88 |
# Start back-up scheduler
|
89 |
print("Starting back-up scheduler (save every 5 minutes)...")
|
|
|
83 |
# If backup is enabled but no backup is found, delete local database to prevent confusion.
|
84 |
print("Couldn't find backup in remote dataset.")
|
85 |
print("Deleting local database for a fresh start.")
|
86 |
+
try:
|
87 |
+
os.remove(constants.DATABASE_FILE)
|
88 |
+
except OSError:
|
89 |
+
pass
|
90 |
|
91 |
# Start back-up scheduler
|
92 |
print("Starting back-up scheduler (save every 5 minutes)...")
|