mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added perf-improving PRAGMAs in testing mode
- These two things are meant to improve performance at the cost of reliability. - Perfect for testing, however I think they make a minimal impact on modern SSDs :( - Still worth a shot to see if it helps with CI
This commit is contained in:
parent
78ee0509bf
commit
80358266b2
2 changed files with 7 additions and 4 deletions
|
@ -17,6 +17,13 @@ function configure(dbConfig) {
|
|||
dbConfig.pool = {
|
||||
afterCreate(conn, cb) {
|
||||
conn.run('PRAGMA foreign_keys = ON', cb);
|
||||
|
||||
// These two are meant to improve performance at the cost of reliability
|
||||
// Should be safe for tests. We add them here and leave them on
|
||||
if (config.get('env').startsWith('testing')) {
|
||||
conn.run('PRAGMA synchronous = OFF;');
|
||||
conn.run('PRAGMA journal_mode = TRUNCATE;');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -157,10 +157,6 @@ const freshModeGhostStart = async (options) => {
|
|||
// Do a full database initialisation
|
||||
await knexMigrator.init();
|
||||
|
||||
if (config.get('database:client') === 'sqlite3') {
|
||||
await db.knex.raw('PRAGMA journal_mode = TRUNCATE;');
|
||||
}
|
||||
|
||||
await settingsService.init();
|
||||
|
||||
// Reset the URL service generators
|
||||
|
|
Loading…
Reference in a new issue