fix: simplify migration save config

This commit is contained in:
José Oliveira 2022-01-21 13:59:58 +00:00
parent bd2d2b06c2
commit 1c4269103b

View file

@ -86,10 +86,8 @@ function migrationSaveConfig (config) {
return loadLatestConfigOrNone() return loadLatestConfigOrNone()
.then(currentConfig => { .then(currentConfig => {
const newConfig = _.assign(currentConfig, config) const newConfig = _.assign(currentConfig, config)
return db.tx(t => { return db.none(configSql, ['config', { config: newConfig }, true, NEW_SETTINGS_LOADER_SCHEMA_VERSION])
return t.none(configSql, ['config', { config: newConfig }, true, NEW_SETTINGS_LOADER_SCHEMA_VERSION]) .catch(console.error)
.then(() => t.none('NOTIFY $1:name, $2', ['poller', JSON.stringify({ type: 'reload', schema: asyncLocalStorage.getStore().get('schema') })]))
}).catch(console.error)
}) })
} }