Fix: healthcheck could shutdown during migration

pull/6204/head
Louis Lam 7 months ago
parent bbc0917acd
commit 5946e684db

@ -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…
Cancel
Save