From d2f55ef225e81d419a59ad9d4dafa78c585d5b69 Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 15 Jun 2023 14:51:58 +0200 Subject: [PATCH] refs #4823 Minor changes --- floriday.js | 4 +--- utils.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/floriday.js b/floriday.js index b6f4663..6112dce 100644 --- a/floriday.js +++ b/floriday.js @@ -49,13 +49,11 @@ class Floriday { async trunk() { try{ - /* for (let model of flModels) await utils.syncModel(model); await utils.checkConnections(); - */ - await utils.deleteConnections(); + } catch (err) { if (['SequelizeConnectionRefusedError', 'SequelizeConnectionError'].includes(err.name)) throw err; diff --git a/utils.js b/utils.js index 41d79d1..05f9ae9 100644 --- a/utils.js +++ b/utils.js @@ -662,7 +662,7 @@ export async function createConnections() { where: { isConnected: true } }); - let connectionsToPut = [], i = 1; + let connectionsToPut = [], i = 0; dbConnections.forEach(valor => { if (!flConnections.includes(valor.organizationId)) connectionsToPut.push(valor.organizationId); @@ -688,7 +688,7 @@ export async function deleteConnections() { where: { isConnected: true } }); - let ghostConnections = [], i = 1; + let ghostConnections = [], i = 0; flConnections.forEach(valor => { if (!dbConnections.includes(valor)) ghostConnections.push(valor);