dsf
All checks were successful
Build and push Docker image / build (push) Successful in 31s

This commit is contained in:
2025-10-01 01:21:47 +04:00
parent 115fc417bf
commit c8db66803f

View File

@@ -51,6 +51,23 @@ app.get('/health/:service', async (req, res) => {
app.use((_, response) => response.sendStatus(404)) app.use((_, response) => response.sendStatus(404))
app.listen(PORT, () => { const server = app.listen(PORT, () => {
console.log(`Health Check Proxy listening on port ${PORT}`) console.log(`@syncraft/healthcheck listening on port ${PORT}`)
}) })
const shutdown_handler = (signal) => {
console.log(`${signal} received. Initiating graceful shutdown.`)
server.close((error) => {
if (error) {
console.error('Error during HTTP server close:', error)
process.exit(1)
}
console.log('HTTP server closed. Exiting process.')
process.exit(0)
});
}
process.on('SIGTERM', () => shutdown_handler('SIGTERM'))
process.on('SIGINT', () => shutdown_handler('SIGINT'))