Verificação de integridade e Desligamento Gracioso

Desligamento Gracioso

Quando você publica uma nova versão do seu aplicativo, você deve substituir a versão anterior. The process manager you’re using will first send a SIGTERM signal to the application to notify it that it will be killed. Once the application gets this signal, it should stop accepting new requests, finish all the ongoing requests, clean up the resources it used, including database connections and file locks then exit.

Exemplo

const server = app.listen(port)

process.on('SIGTERM', () => {
  debug('SIGTERM signal received: closing HTTP server')
  server.close(() => {
    debug('HTTP server closed')
  })
})

Verificações de integridade

A load balancer uses health checks to determine if an application instance is healthy and can accept requests. Por exemplo, Kubernetes tem dois exames de saúde:

Edit this page