samu commited on
Commit
e0ff28f
·
1 Parent(s): bae5892

improved backend

Browse files
backend/__pycache__/db_init.cpython-311.pyc CHANGED
Binary files a/backend/__pycache__/db_init.cpython-311.pyc and b/backend/__pycache__/db_init.cpython-311.pyc differ
 
backend/__pycache__/main.cpython-311.pyc CHANGED
Binary files a/backend/__pycache__/main.cpython-311.pyc and b/backend/__pycache__/main.cpython-311.pyc differ
 
backend/db_init.py CHANGED
@@ -31,7 +31,7 @@ class DatabaseInitializer:
31
  atexit.register(self._cleanup_temp_db)
32
  logger.info(f"Using temporary database: {self.db_path}")
33
  else:
34
- self.db_path = os.getenv("DATABASE_PATH", "/tmp/ai_tutor.db")
35
 
36
  self.schema_path = self._find_schema_file()
37
 
 
31
  atexit.register(self._cleanup_temp_db)
32
  logger.info(f"Using temporary database: {self.db_path}")
33
  else:
34
+ self.db_path = os.getenv("DATABASE_PATH", "/app/ai_tutor.db")
35
 
36
  self.schema_path = self._find_schema_file()
37
 
backend/main.py CHANGED
@@ -45,10 +45,6 @@ async def startup_event():
45
  # Initialize database with health checks
46
  init_result = await db_initializer.initialize_database()
47
 
48
- # Set the db_path for all db instances from the initializer
49
- db.db_path = db_initializer.db_path
50
- api_cache.db_path = db_initializer.db_path
51
-
52
  if init_result["success"]:
53
  logging.info(f"Database initialization successful: {init_result['action_taken']}")
54
 
 
45
  # Initialize database with health checks
46
  init_result = await db_initializer.initialize_database()
47
 
 
 
 
 
48
  if init_result["success"]:
49
  logging.info(f"Database initialization successful: {init_result['action_taken']}")
50