Fix: healthcheck could shutdown during migration (#6204)
This commit is contained in:
commit
5aca422f5d
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "uptime-kuma",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -41,7 +41,7 @@
|
||||
"build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push",
|
||||
"upload-artifacts": "node extra/release/upload-artifacts.mjs",
|
||||
"upload-artifacts-beta": "node extra/release/upload-artifacts-beta.mjs",
|
||||
"setup": "git checkout 2.0.0 && npm ci --omit dev && npm run download-dist",
|
||||
"setup": "git checkout 2.0.1 && npm ci --omit dev && npm run download-dist",
|
||||
"download-dist": "node extra/download-dist.js",
|
||||
"mark-as-nightly": "node extra/mark-as-nightly.js",
|
||||
"reset-password": "node extra/reset-password.js",
|
||||
|
||||
@ -37,6 +37,18 @@ class SimpleMigrationServer {
|
||||
this.server = http.createServer(this.app);
|
||||
|
||||
this.app.get("/", (req, res) => {
|
||||
res.set("Content-Type", "text/html");
|
||||
|
||||
// HTML meta tag redirect to /status
|
||||
res.end(`
|
||||
<html lang="en">
|
||||
<head><meta http-equiv="refresh" content="0; URL=/migrate-status" /></head>
|
||||
<body>Migration server is running.</body>
|
||||
</html>
|
||||
`);
|
||||
});
|
||||
|
||||
this.app.get("/migrate-status", (req, res) => {
|
||||
res.set("Content-Type", "text/plain");
|
||||
res.write("Migration is in progress, listening message...\n");
|
||||
if (this.response) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user