We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1977122 commit ebd46afCopy full SHA for ebd46af
1 file changed
backend/main.py
@@ -308,7 +308,9 @@ def _fix_schema_constraints(db: Session):
308
print(f"⚠️ [DB MIGRATION] Setup failed: {e}")
309
310
# --- 2. Seed Personas (Fresh Session) ---
311
+ db = None
312
try:
313
+ from database import SessionLocal
314
db = SessionLocal()
315
print("🌱 [SEED] Verify Personas in DB...")
316
# Import moved inside to avoid circular deps if any
@@ -350,9 +352,11 @@ def _fix_schema_constraints(db: Session):
350
352
print("✅ [DB] Schema & Seeds synced.")
351
353
except Exception as e:
354
print(f"❌ [DB] Seed Error: {e}")
- db.rollback()
355
+ if db:
356
+ db.rollback()
357
finally:
- db.close()
358
359
+ db.close()
360
361
# Background evaluator (best-effort)
362
0 commit comments