fix: unneeded conditional checks
This commit is contained in:
parent
240203b060
commit
38457bc9d9
1 changed files with 4 additions and 6 deletions
|
|
@ -82,7 +82,7 @@ const populateSettings = function (req, res, next) {
|
||||||
|
|
||||||
const operatorSettings = settingsCache.get(`${operatorId}-latest`)
|
const operatorSettings = settingsCache.get(`${operatorId}-latest`)
|
||||||
|
|
||||||
if (!versionId && (!!needsSettingsReload[operatorId] || !operatorSettings)) {
|
if (!!needsSettingsReload[operatorId] || !operatorSettings) {
|
||||||
!!needsSettingsReload[operatorId]
|
!!needsSettingsReload[operatorId]
|
||||||
? logger.debug('Fetching and caching a new latest config value, as a reload was requested')
|
? logger.debug('Fetching and caching a new latest config value, as a reload was requested')
|
||||||
: logger.debug('Fetching the latest config version because there\'s no cached value')
|
: logger.debug('Fetching the latest config version because there\'s no cached value')
|
||||||
|
|
@ -97,11 +97,9 @@ const populateSettings = function (req, res, next) {
|
||||||
.catch(next)
|
.catch(next)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!versionId && operatorSettings) {
|
logger.debug('Fetching the latest config value from cache')
|
||||||
logger.debug('Fetching the latest config value from cache')
|
req.settings = operatorSettings
|
||||||
req.settings = operatorSettings
|
return next()
|
||||||
return next()
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue