diff --git a/src/ClaudeDo.App/Program.cs b/src/ClaudeDo.App/Program.cs index cb3e95aa..fffebcdc 100644 --- a/src/ClaudeDo.App/Program.cs +++ b/src/ClaudeDo.App/Program.cs @@ -91,8 +91,11 @@ sealed class Program TrExtension.Localizer = localizer; ClaudeDo.Ui.Localization.Loc.Current = localizer; sc.AddSingleton(localizer); + // Default Timeout maps to SQLite's busy handler. Without it a momentarily locked + // database throws SqliteException immediately instead of waiting out the writer, + // which is what leaves task rows stuck on a stale status. sc.AddDbContextFactory(opt => - opt.UseSqlite($"Data Source={dbPath}")); + opt.UseSqlite($"Data Source={dbPath};Default Timeout=30")); sc.AddScoped(sp => sp.GetRequiredService>().CreateDbContext()); diff --git a/src/ClaudeDo.Worker/Program.cs b/src/ClaudeDo.Worker/Program.cs index c4fd4ed1..aa2f06fd 100644 --- a/src/ClaudeDo.Worker/Program.cs +++ b/src/ClaudeDo.Worker/Program.cs @@ -57,8 +57,9 @@ builder.Host.UseSerilog((ctx, lc) => lc .WriteTo.Sink(broadcastSink)); builder.Services.AddSingleton(logBuffer); +// See ClaudeDo.App/Program.cs — Default Timeout maps to SQLite's busy handler. builder.Services.AddDbContextFactory(opt => - opt.UseSqlite($"Data Source={cfg.DbPath}")); + opt.UseSqlite($"Data Source={cfg.DbPath};Default Timeout=30")); builder.Services.AddSingleton(cfg); builder.Services.AddSingleton();