From bc2d499625b2cf5ffa101934fd1f93ba104a769e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 24 Oct 2022 13:33:36 +0100 Subject: [PATCH] Adding a check to see if app backups feature is enabled. --- .../src/api/controllers/deploy/index.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/server/src/api/controllers/deploy/index.ts b/packages/server/src/api/controllers/deploy/index.ts index b3b875e397..f1700aef87 100644 --- a/packages/server/src/api/controllers/deploy/index.ts +++ b/packages/server/src/api/controllers/deploy/index.ts @@ -110,14 +110,17 @@ async function deployApp(deployment: any, userId: string) { // can't do this in test if (!env.isTest()) { - // trigger backup initially - await backups.triggerAppBackup( - productionAppId, - AppBackupTrigger.PUBLISH, - { - createdBy: userId, - } - ) + // don't try this if feature isn't allowed, will error + if (!(await backups.isEnabled())) { + // trigger backup initially + await backups.triggerAppBackup( + productionAppId, + AppBackupTrigger.PUBLISH, + { + createdBy: userId, + } + ) + } } const config: any = {