chore: drop if to idempotent op
This commit is contained in:
parent
aaa02e3186
commit
cb046ea726
1 changed files with 2 additions and 3 deletions
|
|
@ -110,7 +110,7 @@ const populateSettings = function (req, res, next) {
|
||||||
|
|
||||||
const operatorSettings = settingsCache.get(`${operatorId}-latest`)
|
const operatorSettings = settingsCache.get(`${operatorId}-latest`)
|
||||||
|
|
||||||
if (!!needsSettingsReload[operatorId] || !operatorSettings) {
|
if (needsSettingsReload[operatorId] || !operatorSettings) {
|
||||||
needsSettingsReload[operatorId]
|
needsSettingsReload[operatorId]
|
||||||
? logger.debug(
|
? logger.debug(
|
||||||
'Fetching and caching a new latest config value, as a reload was requested',
|
'Fetching and caching a new latest config value, as a reload was requested',
|
||||||
|
|
@ -125,8 +125,7 @@ const populateSettings = function (req, res, next) {
|
||||||
const versionId = settings.version
|
const versionId = settings.version
|
||||||
settingsCache.set(`${operatorId}-latest`, settings)
|
settingsCache.set(`${operatorId}-latest`, settings)
|
||||||
settingsCache.set(`${operatorId}-v${versionId}`, settings)
|
settingsCache.set(`${operatorId}-v${versionId}`, settings)
|
||||||
if (needsSettingsReload[operatorId])
|
delete needsSettingsReload[operatorId]
|
||||||
delete needsSettingsReload[operatorId]
|
|
||||||
req.settings = settings
|
req.settings = settings
|
||||||
})
|
})
|
||||||
.then(() => next())
|
.then(() => next())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue