refactor: rename email-server-worker to email-worker
Rename directory from email-server-worker to email-worker for clarity and brevity. Update all references in CLAUDE.md documentation.
This commit is contained in:
29
email-worker/src/healthcheck.ts
Normal file
29
email-worker/src/healthcheck.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { createLogger } from "./lib/logger";
|
||||
|
||||
import http, { IncomingMessage } from "http";
|
||||
const logger = createLogger("server:healthcheck");
|
||||
|
||||
const options = {
|
||||
host: "localhost",
|
||||
port: "3000",
|
||||
timeout: 2000,
|
||||
path: '/healthcheck/'
|
||||
};
|
||||
|
||||
const request = http.request(options, (res:IncomingMessage) => {
|
||||
|
||||
logger(`Healthcheck: STATUS ${res.statusCode}`);
|
||||
|
||||
if (res.statusCode == 200) {
|
||||
process.exit(0);
|
||||
} else {
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
request.on("error", function (err:any) {
|
||||
logger("Healthcheck: ERROR");
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
request.end();
|
||||
Reference in New Issue
Block a user