Merge pull request #2184 from rootedbox/sql_time_out
Set SQLite busy_timeout to prevent lock contention issues
This commit is contained in:
commit
c6175171f6
4 changed files with 8 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ export class AutocompleteLruCache {
|
|||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
await db.exec("PRAGMA busy_timeout = 3000;");
|
||||
|
||||
await db.run(`
|
||||
CREATE TABLE IF NOT EXISTS cache (
|
||||
key TEXT PRIMARY KEY,
|
||||
|
|
|
|||
|
|
@ -484,6 +484,8 @@ export default class DocsService {
|
|||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
await db.exec("PRAGMA busy_timeout = 3000;");
|
||||
|
||||
await runSqliteMigrations(db);
|
||||
|
||||
await db.exec(`CREATE TABLE IF NOT EXISTS ${DocsService.sqlitebTableName} (
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ export class SqliteDb {
|
|||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
await SqliteDb.db.exec("PRAGMA busy_timeout = 3000;");
|
||||
|
||||
await SqliteDb.createTables(SqliteDb.db);
|
||||
|
||||
return SqliteDb.db;
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ export class DevDataSqliteDb {
|
|||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
await DevDataSqliteDb.db.exec("PRAGMA busy_timeout = 3000;");
|
||||
|
||||
await DevDataSqliteDb.createTables(DevDataSqliteDb.db!);
|
||||
|
||||
return DevDataSqliteDb.db;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue