mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-17 06:24:32 +00:00
Merge branch 'dev' into resource-policies
This commit is contained in:
@@ -48,17 +48,18 @@ function autoFinalizeStatement(
|
|||||||
function createDb() {
|
function createDb() {
|
||||||
const sqlite = new Database(location);
|
const sqlite = new Database(location);
|
||||||
|
|
||||||
// Enable WAL mode — allows concurrent readers + single writer, preventing
|
if (process.env.ENABLE_SQLITE_WAL_MODE == "true") {
|
||||||
// contention across subsystems (verifySession, Traefik, audit, ping).
|
// Enable WAL mode — allows concurrent readers + single writer, preventing
|
||||||
sqlite.pragma("journal_mode = WAL");
|
// contention across subsystems (verifySession, Traefik, audit, ping).
|
||||||
|
sqlite.pragma("journal_mode = WAL");
|
||||||
|
// NORMAL sync mode: safe with WAL, reduces write lock hold time.
|
||||||
|
sqlite.pragma("synchronous = NORMAL");
|
||||||
|
}
|
||||||
|
|
||||||
// Wait up to 5s on SQLITE_BUSY instead of failing — prevents audit log
|
// Wait up to 5s on SQLITE_BUSY instead of failing — prevents audit log
|
||||||
// retry loops that accumulate memory.
|
// retry loops that accumulate memory.
|
||||||
sqlite.pragma("busy_timeout = 5000");
|
sqlite.pragma("busy_timeout = 5000");
|
||||||
|
|
||||||
// NORMAL sync mode: safe with WAL, reduces write lock hold time.
|
|
||||||
sqlite.pragma("synchronous = NORMAL");
|
|
||||||
|
|
||||||
// 64 MB page cache (default 2 MB) — reduces I/O round-trips on large
|
// 64 MB page cache (default 2 MB) — reduces I/O round-trips on large
|
||||||
// TraefikConfigManager JOINs that block the event loop.
|
// TraefikConfigManager JOINs that block the event loop.
|
||||||
sqlite.pragma("cache_size = -65536");
|
sqlite.pragma("cache_size = -65536");
|
||||||
|
|||||||
Reference in New Issue
Block a user