mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Set journal_mode to truncate for SQLite in tests
no issue - we would regularly see IO errors coming from SQLite, which caused random regression tests to fail - the default journal_mode is `delete`, but this is slow and can cause issues when multiple tests try to remove the journal file - `truncate` is faster and shouldn't cause these issues
This commit is contained in:
parent
ef551768bb
commit
1c6583ae03
1 changed files with 7 additions and 0 deletions
|
@ -931,6 +931,13 @@ startGhost = function startGhost(options) {
|
|||
settingsCache.reset();
|
||||
return knexMigrator.init();
|
||||
})
|
||||
.then(function setPragma() {
|
||||
if (config.get('database:client') === 'sqlite3') {
|
||||
return db.knex.raw('PRAGMA journal_mode = TRUNCATE;');
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
})
|
||||
.then(function initializeGhost() {
|
||||
urlService.resetGenerators();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue