mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
feat: better upload.onHold debugging messages
expose util.inspect via utils when on dev mode
This commit is contained in:
parent
32efacd411
commit
c47d3f5437
@ -187,6 +187,10 @@ self.getUniqueUploadIdentifier = async (length, extension = '', res) => {
|
||||
continue
|
||||
}
|
||||
|
||||
if (utils.devmode) {
|
||||
logger.debug(`upload.onHold: ${utils.inspect(self.onHold)}`)
|
||||
}
|
||||
|
||||
// Unhold identifier once the Response has been sent
|
||||
if (res) {
|
||||
if (!res.locals.identifiers) {
|
||||
@ -220,7 +224,10 @@ self.unholdUploadIdentifiers = res => {
|
||||
|
||||
for (const identifier of res.locals.identifiers) {
|
||||
self.onHold.delete(identifier)
|
||||
logger.debug(`Unheld identifier ${identifier}.`)
|
||||
|
||||
if (utils.devmode) {
|
||||
logger.debug(`upload.onHold: ${utils.inspect(self.onHold)} -> ${utils.inspect(identifier)}`)
|
||||
}
|
||||
}
|
||||
|
||||
delete res.locals.identifiers
|
||||
|
@ -16,8 +16,12 @@ const SimpleDataStore = require('./utils/SimpleDataStore')
|
||||
const config = require('./../config')
|
||||
const logger = require('./../logger')
|
||||
|
||||
const devmode = process.env.NODE_ENV === 'development'
|
||||
|
||||
const self = {
|
||||
devmode: process.env.NODE_ENV === 'development',
|
||||
devmode,
|
||||
inspect: devmode && require('util').inspect,
|
||||
|
||||
db: knex(config.database),
|
||||
conf: {
|
||||
// Allow some config options to be overriden via env vars
|
||||
|
Loading…
Reference in New Issue
Block a user