openAndSetUpSQLCipher: Enable checkpoint_fullfsync pragma

This commit is contained in:
Scott Nonnenberg 2024-09-17 23:40:16 +10:00 committed by GitHub
parent f23f86d0e2
commit c97c440b3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -700,6 +700,19 @@ function openAndSetUpSQLCipher(
throw error;
}
try {
// fullfsync is only supported on macOS
db.pragma('fullfsync = false');
// a lower-impact approach, if fullfsync is too impactful
db.pragma('checkpoint_fullfsync = true');
} catch (error) {
logger.warn(
'openAndSetUpSQLCipher: Unable to set fullfsync',
Errors.toLogFormat(error)
);
}
return db;
}