mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
Fix Uptime Kuma cannot be stopped
This commit is contained in:
parent
2dff7dd380
commit
e478084ff9
3 changed files with 10 additions and 1 deletions
|
@ -1740,6 +1740,7 @@ async function shutdownFunction(signal) {
|
||||||
|
|
||||||
stopBackgroundJobs();
|
stopBackgroundJobs();
|
||||||
await cloudflaredStop();
|
await cloudflaredStop();
|
||||||
|
Settings.stopCacheCleaner();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Final function called before application exits */
|
/** Final function called before application exits */
|
||||||
|
|
|
@ -158,6 +158,13 @@ class Settings {
|
||||||
delete Settings.cacheList[key];
|
delete Settings.cacheList[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static stopCacheCleaner() {
|
||||||
|
if (Settings.cacheCleaner) {
|
||||||
|
clearInterval(Settings.cacheCleaner);
|
||||||
|
Settings.cacheCleaner = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
const { checkLogin, setSetting, setting, doubleCheckPassword } = require("../util-server");
|
const { checkLogin, setSetting, setting, doubleCheckPassword } = require("../util-server");
|
||||||
const { CloudflaredTunnel } = require("node-cloudflared-tunnel");
|
const { CloudflaredTunnel } = require("node-cloudflared-tunnel");
|
||||||
const { UptimeKumaServer } = require("../uptime-kuma-server");
|
const { UptimeKumaServer } = require("../uptime-kuma-server");
|
||||||
|
const { log } = require("../../src/util");
|
||||||
const io = UptimeKumaServer.getInstance().io;
|
const io = UptimeKumaServer.getInstance().io;
|
||||||
|
|
||||||
const prefix = "cloudflared_";
|
const prefix = "cloudflared_";
|
||||||
|
@ -107,7 +108,7 @@ module.exports.autoStart = async (token) => {
|
||||||
|
|
||||||
/** Stop cloudflared */
|
/** Stop cloudflared */
|
||||||
module.exports.stop = async () => {
|
module.exports.stop = async () => {
|
||||||
console.log("Stop cloudflared");
|
log.info("cloudflared", "Stop cloudflared");
|
||||||
if (cloudflared) {
|
if (cloudflared) {
|
||||||
cloudflared.stop();
|
cloudflared.stop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue