aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Shares
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-11-16 18:38:04 -0600
committerGitHub <noreply@github.com>2025-11-16 18:38:04 -0600
commit3d4661d3eec83d9c42932501c340abe27f201f8a (patch)
tree66fd158fd75639b317ec48561f00102f0064088b /src/slskd/Shares
parent27aaa276ae2365f336ac2c963856727bb19750bb (diff)
parent70f16315cf407bdaa5487e9b818acd98704714cf (diff)
downloadslskd-3d4661d3eec83d9c42932501c340abe27f201f8a.tar.gz
Merge pull request #1529 from slskd/sqlite-again
Ensure SQLite PRAGMAs journal_mode=wal and synchronous=1 (NORMAL) are set during initialization
Diffstat (limited to 'src/slskd/Shares')
-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)
{