mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 11:55:01 +03:00
Moved sqlite3 override rules to db connection lib
- We have an already established location for special rules based on db client - Removes the need to require config inside of overrides
This commit is contained in:
parent
f6a7abdf5a
commit
256b77b0e4
@ -12,7 +12,12 @@ function configure(dbConfig) {
|
||||
const client = dbConfig.client;
|
||||
|
||||
if (client === 'sqlite3') {
|
||||
// Backwards compatibility with old knex behaviour
|
||||
dbConfig.useNullAsDefault = Object.prototype.hasOwnProperty.call(dbConfig, 'useNullAsDefault') ? dbConfig.useNullAsDefault : true;
|
||||
|
||||
// Force bthreads to use child_process backend until a worker_thread-compatible version of sqlite3 is published
|
||||
// https://github.com/mapbox/node-sqlite3/issues/1386
|
||||
process.env.BTHREADS_BACKEND = 'child_process';
|
||||
}
|
||||
|
||||
if (client === 'mysql') {
|
||||
|
@ -1,5 +1,3 @@
|
||||
const config = require('../shared/config');
|
||||
|
||||
/**
|
||||
* If we enable bluebird debug logs we see a huge memory usage.
|
||||
* You can reproduce by removing this line and import a big database export into Ghost.
|
||||
@ -7,15 +5,6 @@ const config = require('../shared/config');
|
||||
*/
|
||||
process.env.BLUEBIRD_DEBUG = 0;
|
||||
|
||||
/**
|
||||
* Force bthreads to use child_process backend until a worker_thread-compatible version of sqlite3 is published
|
||||
* https://github.com/mapbox/node-sqlite3/issues/1386
|
||||
*/
|
||||
const isSQLite = config.get('database:client') === 'sqlite3';
|
||||
if (isSQLite) {
|
||||
process.env.BTHREADS_BACKEND = 'child_process';
|
||||
}
|
||||
|
||||
const moment = require('moment-timezone');
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user