From f71d71104a2137e3e029bfb7499e38ffa5376410 Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 12 Dec 2017 23:35:41 -0500 Subject: [PATCH] set db as ready only if migration fully succeeded --- services/migration.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/migration.js b/services/migration.js index c663e9703..8748a1cfa 100644 --- a/services/migration.js +++ b/services/migration.js @@ -70,8 +70,6 @@ async function migrate() { await options.setOption("db_version", mig.dbVersion); }); - sql.setDbReadyAsResolved(); - log.info("Migration to version " + mig.dbVersion + " has been successful."); mig['success'] = true; @@ -86,6 +84,10 @@ async function migrate() { } } + if (sql.isDbUpToDate()) { + sql.setDbReadyAsResolved(); + } + return migrations; }