Spaces:
Running
Running
Commit ·
5b515c5
1
Parent(s): d6581ab
Fix: Drop stale EFMigrationsLock and close connection to prevent rolling update deadlock
Browse files122 unmodified lines12312412512612712812913016 unmodified lines147148149150151152122 unmodified linesdb.Database.OpenConnection();using (var command = db.Database.GetDbConnection().CreateCommand()){// 1. Basic settings for stabilitycommand.CommandText = "PRAGMA journal_mode=TRUNCATE; PRAGMA synchronous=NORMAL; PRAGMA busy_timeout=10000;";command.ExecuteNonQuery();// 2. DELETE OVERSIZED RECORDS (Possible cause of I/O hang)16 unmodified lines{Console.WriteLine($"[Warning] Emergency cleanup failed: {ex.Message}");}// Run Migrations with a reasonable timeoutdb.Database.SetCommandTimeout(120); // 2 minutes122 unmodified lines12312412512612712812913016 unmodified lines147148149150151152153154155156122 unmodified linesdb.Database.OpenConnection();using (var command = db.Database.GetDbConnection().CreateCommand()){// 1. Basic settings for stability and drop stale migration lockscommand.CommandText = "PRAGMA journal_mode=TRUNCATE; PRAGMA synchronous=NORMAL; PRAGMA busy_timeout=10000; DROP TABLE IF EXISTS __EFMigrationsLock;";command.ExecuteNonQuery();// 2. DELETE OVERSIZED RECORDS (Possible cause of I/O hang)16 unmodified lines{Console.WriteLine($"[Warning] Emergency cleanup failed: {ex.Message}");}finally{try { db.Database.CloseConnection(); } catch {}}// Run Migrations with a reasonable timeoutdb.Database.SetCommandTimeout(120); // 2 minutes
FlowAPI/Program.cs+6-2