🔨 Add "Create Backup Timeout" in addon settings #111

This commit is contained in:
SebClem 2022-02-14 11:39:04 +01:00
parent 65fb449a4a
commit f7177dbd70
No known key found for this signature in database
GPG Key ID: 3D8E353F900B1305
3 changed files with 13 additions and 5 deletions

View File

@ -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,
@ -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)"
}
}

View File

@ -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();

View File

@ -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() {