From 9aea69bbdcf9d46d536920ee7f63870a9babebf9 Mon Sep 17 00:00:00 2001 From: Sebastien Date: Sat, 15 Feb 2020 16:20:24 +0100 Subject: [PATCH] :ambulance: Fix condition #7 --- .../rootfs/opt/nextcloud_backup/tools/cronTools.js | 2 +- .../rootfs/opt/nextcloud_backup/tools/hassioApiTools.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/cronTools.js b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/cronTools.js index cbc0b5c..1224f09 100644 --- a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/cronTools.js +++ b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/cronTools.js @@ -121,7 +121,7 @@ class CronContainer { _createBackup() { logger.debug('Cron triggered !'); let status = statusTools.getStatus(); - if (status.status === "creating" && status.status === "upload" && status.status === "download") + if (status.status === "creating" || status.status === "upload" || status.status === "download") return; let name = 'Auto-' + moment().format('YYYY-MM-DD_HH:mm'); diff --git a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js index 510cfdb..ce51e95 100644 --- a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js +++ b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js @@ -166,7 +166,7 @@ function createNewBackup(name) { timeout: 1200000 } request.post(option, (error, response, body) => { - if (response.statusCode != 200) { + if (response.statusCode !== 200) { status.status = "error"; status.message = "Can't create new snapshot (" + error + ")"; status.error_code = 5; @@ -175,7 +175,7 @@ function createNewBackup(name) { reject(status.message); } else { - body.data.slug + body.data.slug; console.log('Snapshot created with id ' + body.data.slug); resolve(body.data.slug); }