mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-14 15:47:14 +03:00
Enable write-ahead log for SQLite connections to prevent blocking concurrent writes and reads
This commit is contained in:
parent
3e891e19c3
commit
9ca56bd910
@ -24,7 +24,14 @@ namespace DHT.Server.Database.Sqlite.Utils {
|
||||
for (int i = 0; i < poolSize; i++) {
|
||||
var conn = new SqliteConnection(connectionString);
|
||||
conn.Open();
|
||||
free.Add(new PooledConnection(this, conn));
|
||||
|
||||
var pooledConn = new PooledConnection(this, conn);
|
||||
|
||||
using (var cmd = pooledConn.Command("PRAGMA journal_mode=WAL")) {
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
free.Add(pooledConn);
|
||||
}
|
||||
|
||||
used = new List<PooledConnection>(poolSize);
|
||||
|
Loading…
x
Reference in New Issue
Block a user