Merge pull request #966 from omgbeez/upstream/db-close-fix

fix(service): Clear SQLite connection pools on service stop
This commit is contained in:
Roger Far 2026-04-28 20:30:13 -06:00 committed by GitHub
commit 2d8983050d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,5 @@
using System.Reflection; using System.Reflection;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
@ -39,6 +40,9 @@ public class Startup(IServiceProvider serviceProvider) : IHostedService
public Task StopAsync(CancellationToken cancellationToken) public Task StopAsync(CancellationToken cancellationToken)
{ {
Ready = false;
SqliteConnection.ClearAllPools();
return Task.CompletedTask; return Task.CompletedTask;
} }
} }