Skip to content

Commit

Permalink
🔨 Add "Create Backup Timeout" in addon settings #111
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebclem committed Feb 14, 2022
1 parent 65fb449 commit f7177db
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 6 additions & 4 deletions nextcloud_backup/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Nextcloud Backup",
"version": "dev",
"slug": "nextcloud_backup",
"description": "Easily backup your Home Assistant snapshots to Nextcloud",
"description": "Easily upload your Home Assistant backups to Nextcloud",
"url": "https://github.com/Sebclem/hassio-nextcloud-backup",
"webui": "[PROTO:ssl]://[HOST]:[PORT:3000]/",
"ingress": true,
Expand All @@ -24,15 +24,17 @@
"hassio_role": "admin",
"homeassistant_api": true,
"options": {
"log_level": "info"
"log_level": "info",
"create_backup_timeout": 5400000
},
"schema": {
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)?"
"log_level": "list(trace|debug|info|notice|warning|error|fatal)",
"create_backup_timeout": "int"
},
"ports": {
"3000/tcp": null
},
"ports_description": {
"3000/tcp": "Web interface (Not required for Hass.io Ingress)"
"3000/tcp": "Web interface (Not required for Home Assistant Ingress)"
}
}
5 changes: 5 additions & 0 deletions nextcloud_backup/rootfs/opt/nextcloud_backup/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ app.use(function (err, req, res, next) {
Init app
----------------------------------------------------------
*/

const fs = require("fs");
const newlog = require("./config/winston");

newlog.info(`Log level: ${ process.env.LOG_LEVEL }`);
newlog.info(`Backup timeout: ${ parseInt(process.env.CREATE_BACKUP_TIMEOUT) || ( 90 * 60 * 1000 ) }`)

if (!fs.existsSync("/data")) fs.mkdirSync("/data");
const statusTools = require("./tools/status");
statusTools.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const statusTools = require("./status");
const settingsTools = require("./settingsTools");
const logger = require("../config/winston");

const create_snap_timeout = 90 * 60 * 1000;
// Default timout to 90min
const create_snap_timeout = parseInt(process.env.CREATE_BACKUP_TIMEOUT) || ( 90 * 60 * 1000 );


function getVersion() {
Expand Down

0 comments on commit f7177db

Please sign in to comment.