Skip to content

Commit

Permalink
✏️ Some code clean...
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebclem committed Jan 7, 2021
1 parent f34154a commit d85c047
Show file tree
Hide file tree
Showing 6 changed files with 329 additions and 333 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const appRoot = require("app-root-path");
const winston = require("winston");

const logger = winston.createLogger({
level: process.env.LOG_LEVEL || 'info' ,
level: process.env.LOG_LEVEL || 'info',
format: winston.format.combine(
winston.format.timestamp({
format: "YYYY-MM-DD HH:mm:ss",
Expand Down
23 changes: 12 additions & 11 deletions nextcloud_backup/rootfs/opt/nextcloud_backup/tools/cronTools.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
const settingsTools = require("./settingsTools");
const CronJob = require("cron").CronJob;

const settingsTools = require("./settingsTools");
const WebdavTools = require("./webdavTools");
const webdav = new WebdavTools().getInstance();

const hassioApiTools = require("./hassioApiTools");

const statusTools = require("./status");

const pathTools = require("./pathTools");

const CronJob = require("cron").CronJob;
const moment = require("moment");
const logger = require("../config/winston");

function startCron() {
Expand Down Expand Up @@ -100,21 +96,26 @@ class CronContainer {
.then(() => {
webdav.uploadFile(id, webdav.getConf().back_dir + pathTools.auto + name + ".tar");
})
.catch(() => {});
.catch(() => {
});
})
.catch(() => {});
.catch(() => {
});
})
.catch(() => {});
.catch(() => {
});
}

_clean() {
let autoCleanlocal = settingsTools.getSettings().auto_clean_local;
if (autoCleanlocal != null && autoCleanlocal === "true") {
hassioApiTools.clean().catch(() => {});
hassioApiTools.clean().catch(() => {
});
}
let autoCleanCloud = settingsTools.getSettings().auto_clean_backup;
if (autoCleanCloud != null && autoCleanCloud === "true") {
webdav.clean().catch(() => {});
webdav.clean().catch(() => {
});
}
}
}
Expand Down
Loading

0 comments on commit d85c047

Please sign in to comment.