config load immediatly and once

This commit is contained in:
lesion 2022-06-18 01:15:52 +02:00
parent 3e33252d06
commit d6f647ccd2
No known key found for this signature in database
GPG key ID: 352918250B012177
5 changed files with 1 additions and 4 deletions

View file

@ -1,5 +1,4 @@
const config = require('./server/config.js') const config = require('./server/config.js')
config.load()
const minifyTheme = require('minify-css-string').default const minifyTheme = require('minify-css-string').default
const isDev = (process.env.NODE_ENV !== 'production') const isDev = (process.env.NODE_ENV !== 'production')

View file

@ -1,7 +1,6 @@
let db let db
function _initializeDB () { function _initializeDB () {
const config = require('../config') const config = require('../config')
config.load()
config.log_level = 'error' config.log_level = 'error'
db = require('../api/models/index') db = require('../api/models/index')
return db.initialize() return db.initialize()

View file

@ -37,4 +37,5 @@ let config = {
} }
} }
config.load()
module.exports = config module.exports = config

View file

@ -1,4 +1,3 @@
// needed by sequelize // needed by sequelize
const config = require('./config') const config = require('./config')
config.load()
module.exports = config.db module.exports = config.db

View file

@ -1,5 +1,4 @@
const config = require('../server/config') const config = require('../server/config')
config.load()
const initialize = { const initialize = {
// close connections/port/unix socket // close connections/port/unix socket