mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Removed logging require in db/connection.js
(#12690)
refs https://github.com/TryGhost/Ghost/issues/12496 - having the logging require here means that workers wanting to use the db are unable to do so without requiring logging as a side-effect - `connection.loggingHook` does not appear to be widely used for anything outside of specific debugging scenarios when using MySQL so it should be safe to disable until a proper fix is found for workers+logging leaking file descriptors
This commit is contained in:
parent
42e452b127
commit
95105836aa
@ -1,7 +1,5 @@
|
||||
const knex = require('knex');
|
||||
const config = require('../../../shared/config');
|
||||
const logging = require('../../../shared/logging');
|
||||
const errors = require('@tryghost/errors');
|
||||
let knexInstance;
|
||||
|
||||
// @TODO:
|
||||
@ -24,12 +22,18 @@ function configure(dbConfig) {
|
||||
dbConfig.connection.timezone = 'UTC';
|
||||
dbConfig.connection.charset = 'utf8mb4';
|
||||
|
||||
dbConfig.connection.loggingHook = function loggingHook(err) {
|
||||
logging.error(new errors.InternalServerError({
|
||||
code: 'MYSQL_LOGGING_HOOK',
|
||||
err: err
|
||||
}));
|
||||
};
|
||||
// NOTE: disabled so that worker processes can use the db without
|
||||
// requiring logging and causing file desriptor leaks.
|
||||
// See https://github.com/TryGhost/Ghost/issues/12496
|
||||
//
|
||||
// const logging = require('../../../shared/logging');
|
||||
// const errors = require('@tryghost/errors');
|
||||
// dbConfig.connection.loggingHook = function loggingHook(err) {
|
||||
// logging.error(new errors.InternalServerError({
|
||||
// code: 'MYSQL_LOGGING_HOOK',
|
||||
// err: err
|
||||
// }));
|
||||
// };
|
||||
}
|
||||
|
||||
return dbConfig;
|
||||
|
Loading…
Reference in New Issue
Block a user