Skip to content

Commit 54fd3bb

Browse files
committed
fix: keep SQLite pragma tuning best effort
Log transient PRAGMA setup failures instead of blocking SQLite connection acquisition so performance tuning cannot prevent startup.
1 parent 6083289 commit 54fd3bb

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/database/sqlite-pragmas.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { logger } from '../config/logger.js';
2+
13
const SQLITE_PRAGMAS = [
24
'PRAGMA synchronous = NORMAL',
35
'PRAGMA cache_size = -65536',
@@ -34,8 +36,13 @@ export const installSqlitePragmas = (sequelize) => {
3436
const connection = await getConnection(...args);
3537

3638
if (!configuredConnections.has(connection)) {
37-
await applySqlitePragmas(connection);
38-
configuredConnections.add(connection);
39+
try {
40+
await applySqlitePragmas(connection);
41+
configuredConnections.add(connection);
42+
} catch (error) {
43+
const message = error instanceof Error ? error.message : String(error);
44+
logger.warn(`Could not apply SQLite PRAGMAs: ${message}`);
45+
}
3946
}
4047

4148
return connection;

0 commit comments

Comments
 (0)