mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +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);
|
||||
}
|
||||
|
||||
// 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");
|
||||
Dialect.prototype._driver = () => require("@louislam/sqlite3");
|
||||
|
||||
|
|
|
@ -1443,11 +1443,14 @@ message HealthCheckResponse {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.monitor.type === "snmp") {
|
||||
// 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") {
|
||||
// snmp is not expected to be executed via the internet => we can choose a lower default timeout
|
||||
this.monitor.timeout = 5;
|
||||
} else {
|
||||
this.monitor.timeout = 48;
|
||||
this.monitor.timeout = 5;
|
||||
} else {
|
||||
this.monitor.timeout = 48;
|
||||
}
|
||||
}
|
||||
|
||||
// Set default SNMP version
|
||||
|
|
Loading…
Reference in a new issue