mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 08:44:04 +00:00
Compare commits
3 commits
304af9ab86
...
3c007eff13
Author | SHA1 | Date | |
---|---|---|---|
|
3c007eff13 | ||
|
4228dd0a29 | ||
|
9c4c60e270 |
2 changed files with 16 additions and 4 deletions
|
@ -236,6 +236,15 @@ class Database {
|
||||||
fs.copyFileSync(Database.templatePath, Database.sqlitePath);
|
fs.copyFileSync(Database.templatePath, Database.sqlitePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if Database.sqlitePath is on NFS
|
||||||
|
if (fs.existsSync(Database.sqlitePath)) {
|
||||||
|
let stats = fs.statSync(Database.sqlitePath);
|
||||||
|
log.debug("server", "SQLite database inode: " + stats.ino);
|
||||||
|
if (stats.ino === 0) {
|
||||||
|
log.error("server", "It seems that the database is on a network drive (NFS). Uptime Kuma will be UNSTABLE and the database will be CORRUPTED. Please use a local disk.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const Dialect = require("knex/lib/dialects/sqlite3/index.js");
|
const Dialect = require("knex/lib/dialects/sqlite3/index.js");
|
||||||
Dialect.prototype._driver = () => require("@louislam/sqlite3");
|
Dialect.prototype._driver = () => require("@louislam/sqlite3");
|
||||||
|
|
||||||
|
|
|
@ -1443,12 +1443,15 @@ message HealthCheckResponse {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set a default timeout if the monitor type has changed or if it's a new monitor
|
||||||
|
if (oldType || this.isAdd) {
|
||||||
if (this.monitor.type === "snmp") {
|
if (this.monitor.type === "snmp") {
|
||||||
// snmp is not expected to be executed via the internet => we can choose a lower default timeout
|
// snmp is not expected to be executed via the internet => we can choose a lower default timeout
|
||||||
this.monitor.timeout = 5;
|
this.monitor.timeout = 5;
|
||||||
} else {
|
} else {
|
||||||
this.monitor.timeout = 48;
|
this.monitor.timeout = 48;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set default SNMP version
|
// Set default SNMP version
|
||||||
if (!this.monitor.snmpVersion) {
|
if (!this.monitor.snmpVersion) {
|
||||||
|
|
Loading…
Reference in a new issue