From 1c4269103b2d75a5815fed48486ce6d35213da40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Fri, 21 Jan 2022 13:59:58 +0000 Subject: [PATCH] fix: simplify migration save config --- lib/new-settings-loader.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/new-settings-loader.js b/lib/new-settings-loader.js index 5d781c17..2f812c51 100644 --- a/lib/new-settings-loader.js +++ b/lib/new-settings-loader.js @@ -86,10 +86,8 @@ function migrationSaveConfig (config) { return loadLatestConfigOrNone() .then(currentConfig => { const newConfig = _.assign(currentConfig, config) - return db.tx(t => { - return t.none(configSql, ['config', { config: newConfig }, true, NEW_SETTINGS_LOADER_SCHEMA_VERSION]) - .then(() => t.none('NOTIFY $1:name, $2', ['poller', JSON.stringify({ type: 'reload', schema: asyncLocalStorage.getStore().get('schema') })])) - }).catch(console.error) + return db.none(configSql, ['config', { config: newConfig }, true, NEW_SETTINGS_LOADER_SCHEMA_VERSION]) + .catch(console.error) }) }