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`)
|
||||
|
||||
if (!versionId && (!!needsSettingsReload[operatorId] || !operatorSettings)) {
|
||||
if (!!needsSettingsReload[operatorId] || !operatorSettings) {
|
||||
!!needsSettingsReload[operatorId]
|
||||
? 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')
|
||||
|
|
@ -97,11 +97,9 @@ const populateSettings = function (req, res, next) {
|
|||
.catch(next)
|
||||
}
|
||||
|
||||
if (!versionId && operatorSettings) {
|
||||
logger.debug('Fetching the latest config value from cache')
|
||||
req.settings = operatorSettings
|
||||
return next()
|
||||
}
|
||||
logger.debug('Fetching the latest config value from cache')
|
||||
req.settings = operatorSettings
|
||||
return next()
|
||||
} catch (e) {
|
||||
logger.error(e)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue