Wauplin HF Staff commited on
Commit
47d42ba
·
verified ·
1 Parent(s): 9df7818

do not fail if local db doesn't exist

Browse files
Files changed (1) hide show
  1. backend/src/app_factory.py +4 -1
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
- os.remove(constants.DATABASE_FILE)
 
 
 
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)...")