mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-22 09:12:58 +01:00
🚑 Fix condition #7
This commit is contained in:
parent
24f6a8c552
commit
9aea69bbdc
@ -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');
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user