🚑 Fix condition #7

This commit is contained in:
Sebastien 2020-02-15 16:20:24 +01:00
parent 24f6a8c552
commit 9aea69bbdc
2 changed files with 3 additions and 3 deletions

View File

@ -121,7 +121,7 @@ class CronContainer {
_createBackup() { _createBackup() {
logger.debug('Cron triggered !'); logger.debug('Cron triggered !');
let status = statusTools.getStatus(); 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; return;
let name = 'Auto-' + moment().format('YYYY-MM-DD_HH:mm'); let name = 'Auto-' + moment().format('YYYY-MM-DD_HH:mm');

View File

@ -166,7 +166,7 @@ function createNewBackup(name) {
timeout: 1200000 timeout: 1200000
} }
request.post(option, (error, response, body) => { request.post(option, (error, response, body) => {
if (response.statusCode != 200) { if (response.statusCode !== 200) {
status.status = "error"; status.status = "error";
status.message = "Can't create new snapshot (" + error + ")"; status.message = "Can't create new snapshot (" + error + ")";
status.error_code = 5; status.error_code = 5;
@ -175,7 +175,7 @@ function createNewBackup(name) {
reject(status.message); reject(status.message);
} }
else { else {
body.data.slug body.data.slug;
console.log('Snapshot created with id ' + body.data.slug); console.log('Snapshot created with id ' + body.data.slug);
resolve(body.data.slug); resolve(body.data.slug);
} }