Browse Source

Fix startup crash when data directory doesn't exist

Add parents=True to mkdir calls for archive_dir and plate_calibration_dir
in config.py to create the full directory tree on first run.
maziggy 4 months ago
parent
commit
8f30f08559
2 changed files with 2 additions and 7 deletions
  1. 0 5
      =2.8.0
  2. 2 2
      backend/app/core/config.py

+ 0 - 5
=2.8.0

@@ -1,5 +0,0 @@
-Collecting PyJWT
-  Downloading PyJWT-2.10.1-py3-none-any.whl.metadata (4.0 kB)
-Downloading PyJWT-2.10.1-py3-none-any.whl (22 kB)
-Installing collected packages: PyJWT
-Successfully installed PyJWT-2.10.1

+ 2 - 2
backend/app/core/config.py

@@ -77,8 +77,8 @@ class Settings(BaseSettings):
 settings = Settings()
 settings = Settings()
 
 
 # Ensure directories exist
 # Ensure directories exist
-settings.archive_dir.mkdir(exist_ok=True)
-settings.plate_calibration_dir.mkdir(exist_ok=True)
+settings.archive_dir.mkdir(parents=True, exist_ok=True)
+settings.plate_calibration_dir.mkdir(parents=True, exist_ok=True)
 settings.static_dir.mkdir(exist_ok=True)
 settings.static_dir.mkdir(exist_ok=True)
 if settings.log_to_file:
 if settings.log_to_file:
     settings.log_dir.mkdir(exist_ok=True)
     settings.log_dir.mkdir(exist_ok=True)