Fix: healthcheck could shutdown during migration
This commit is contained in:
parent
bbc0917acd
commit
5946e684db
@ -37,6 +37,18 @@ class SimpleMigrationServer {
|
|||||||
this.server = http.createServer(this.app);
|
this.server = http.createServer(this.app);
|
||||||
|
|
||||||
this.app.get("/", (req, res) => {
|
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.set("Content-Type", "text/plain");
|
||||||
res.write("Migration is in progress, listening message...\n");
|
res.write("Migration is in progress, listening message...\n");
|
||||||
if (this.response) {
|
if (this.response) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user