danylokhodus commited on
Commit
fc5a6ca
·
1 Parent(s): f00923d

fix: forcefully disable automatic migrations and clear SQLite lock files to bypass server hang

Browse files
Files changed (1) hide show
  1. FlowAPI/Program.cs +12 -2
FlowAPI/Program.cs CHANGED
@@ -149,8 +149,18 @@ namespace FlowAPI
149
  }
150
 
151
  // Run Migrations with a reasonable timeout
152
- db.Database.SetCommandTimeout(120); // 2 minutes
153
- db.Database.Migrate();
 
 
 
 
 
 
 
 
 
 
154
 
155
  // Auto-seed achievements
156
  var achievementService = scope.ServiceProvider.GetRequiredService<IAchievementService>();
 
149
  }
150
 
151
  // Run Migrations with a reasonable timeout
152
+ // db.Database.SetCommandTimeout(120); // 2 minutes
153
+ // db.Database.Migrate();
154
+
155
+ // Manual lock clearing
156
+ try {
157
+ string dbPath = "/app/taskflow.db";
158
+ if (File.Exists(dbPath)) {
159
+ foreach (var s in new[] { "-wal", "-shm", "-journal" }) {
160
+ if (File.Exists(dbPath + s)) File.Delete(dbPath + s);
161
+ }
162
+ }
163
+ } catch {}
164
 
165
  // Auto-seed achievements
166
  var achievementService = scope.ServiceProvider.GetRequiredService<IAchievementService>();