mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-06-19 00:04:04 +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++) {
|
for (int i = 0; i < poolSize; i++) {
|
||||||
var conn = new SqliteConnection(connectionString);
|
var conn = new SqliteConnection(connectionString);
|
||||||
conn.Open();
|
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);
|
used = new List<PooledConnection>(poolSize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user