mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 07:11:37 +08:00
Merge remote-tracking branch 'origin/master' into doubles-ss_master
# Conflicts: # server/database.js
This commit is contained in:
@@ -70,6 +70,7 @@ class Database {
|
||||
"patch-maintenance-table2.sql": true,
|
||||
"patch-add-gamedig-monitor.sql": true,
|
||||
"patch-add-google-analytics-status-page-tag.sql": true,
|
||||
"patch-http-body-encoding.sql": true
|
||||
"patch-monitor-tls.sql": true,
|
||||
};
|
||||
|
||||
@@ -497,6 +498,16 @@ class Database {
|
||||
const shmPath = Database.path + "-shm";
|
||||
const walPath = Database.path + "-wal";
|
||||
|
||||
// Make sure we have a backup to restore before deleting old db
|
||||
if (
|
||||
!fs.existsSync(this.backupPath)
|
||||
&& !fs.existsSync(shmPath)
|
||||
&& !fs.existsSync(walPath)
|
||||
) {
|
||||
log.error("db", "Backup file not found! Leaving database in failed state.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Delete patch failed db
|
||||
try {
|
||||
if (fs.existsSync(Database.path)) {
|
||||
|
Reference in New Issue
Block a user