aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Program.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-11-16 18:34:28 -0600
committerJP Dillingham <jp@dillingham.me>2025-11-16 18:34:48 -0600
commit70f16315cf407bdaa5487e9b818acd98704714cf (patch)
tree66fd158fd75639b317ec48561f00102f0064088b /src/slskd/Program.cs
parent4e826f74bfb40a8741c78b2a41d4afdf9a34699c (diff)
downloadslskd-70f16315cf407bdaa5487e9b818acd98704714cf.tar.gz
use an interceptor to set synchronous pragma for each connection
Diffstat (limited to 'src/slskd/Program.cs')
-rw-r--r--src/slskd/Program.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 639d3a88..ee9e2d0c 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -1209,6 +1209,7 @@ namespace slskd
services.AddDbContextFactory<T>(options =>
{
options.UseSqlite(connectionString);
+ options.AddInterceptors(new SqliteConnectionOpenedInterceptor());
if (OptionsAtStartup.Debug && OptionsAtStartup.Flags.LogSQL)
{
@@ -1230,9 +1231,7 @@ namespace slskd
/*
set (and validate) our desired PRAGMAs
- note: synchronous mode wants to default to 2, and setting it here may not actually do anything
- an alternative would be to set it at the start of each new connection, but i'm unsure if that
- would have the intended effect. revisit later.
+ synchronous mode is also set upon every connection via SqliteConnectionOpenedInterceptor.
*/
ctx.Database.OpenConnection();
var conn = ctx.Database.GetDbConnection();