aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-11-16 15:28:24 -0600
committerJP Dillingham <jp@dillingham.me>2025-11-16 15:28:24 -0600
commit83a64887d3ef6fea35e4752ebcf80f10a4a6eaca (patch)
tree45caf39399cfe0d1425407878d4f13e1374d3c62 /src/slskd
parent30889200a22de1364ffdf1824fa209ec4144ef1b (diff)
downloadslskd-83a64887d3ef6fea35e4752ebcf80f10a4a6eaca.tar.gz
set synchronous pragma for shares to off
Diffstat (limited to 'src/slskd')
-rw-r--r--src/slskd/Shares/SqliteShareRepository.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/slskd/Shares/SqliteShareRepository.cs b/src/slskd/Shares/SqliteShareRepository.cs
index f457adba..711bb21e 100644
--- a/src/slskd/Shares/SqliteShareRepository.cs
+++ b/src/slskd/Shares/SqliteShareRepository.cs
@@ -157,7 +157,9 @@ namespace slskd.Shares
{
using var conn = GetConnection();
- conn.ExecuteNonQuery("PRAGMA journal_mode=WAL");
+ // warning: with synchronous=0, an operating system crash can leave the database corrupted.
+ // if this occurs we should generate a new one, so this is _probably_ ok
+ conn.ExecuteNonQuery("PRAGMA journal_mode=WAL; PRAGMA synchronous=0;");
if (discardExisting)
{