1
0
Fork 0
mirror of synced 2024-09-17 17:57:47 +12:00

Fix startup

This commit is contained in:
Rory Powell 2022-04-26 16:19:41 +01:00
parent 3258aead45
commit a293986bd7

View file

@ -93,6 +93,7 @@ async function initDeployedApp(prodAppId: any) {
} }
async function deployApp(deployment: any) { async function deployApp(deployment: any) {
let replication
try { try {
const appId = getAppId() const appId = getAppId()
const devAppId = getDevelopmentAppID(appId) const devAppId = getDevelopmentAppID(appId)
@ -102,7 +103,7 @@ async function deployApp(deployment: any) {
source: devAppId, source: devAppId,
target: productionAppId, target: productionAppId,
} }
var replication = new Replication(config) replication = new Replication(config)
console.log("Replication object created") console.log("Replication object created")
await replication.replicate() await replication.replicate()
@ -126,9 +127,11 @@ async function deployApp(deployment: any) {
message: `Deployment Failed: ${err.message}`, message: `Deployment Failed: ${err.message}`,
} }
} finally { } finally {
if (replication) {
await replication.close() await replication.close()
} }
} }
}
export async function fetchDeployments(ctx: any) { export async function fetchDeployments(ctx: any) {
try { try {