From a293986bd75b8af5f7298ba5eaf401faa21a6b24 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 26 Apr 2022 16:19:41 +0100 Subject: [PATCH] Fix startup --- packages/server/src/api/controllers/deploy/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/deploy/index.ts b/packages/server/src/api/controllers/deploy/index.ts index 13bc1d3173..99080d9da0 100644 --- a/packages/server/src/api/controllers/deploy/index.ts +++ b/packages/server/src/api/controllers/deploy/index.ts @@ -93,6 +93,7 @@ async function initDeployedApp(prodAppId: any) { } async function deployApp(deployment: any) { + let replication try { const appId = getAppId() const devAppId = getDevelopmentAppID(appId) @@ -102,7 +103,7 @@ async function deployApp(deployment: any) { source: devAppId, target: productionAppId, } - var replication = new Replication(config) + replication = new Replication(config) console.log("Replication object created") await replication.replicate() @@ -126,7 +127,9 @@ async function deployApp(deployment: any) { message: `Deployment Failed: ${err.message}`, } } finally { - await replication.close() + if (replication) { + await replication.close() + } } }