Skip to content

Bug in pool.end () never returns when trying to close cleanly #2341

Open
@mehtcrystals

Description

@mehtcrystals

I have the following code to terminate nodejs cleanly:

process.on('SIGINT', () => {
  console.info('Señal SIGINT recivida');
  console.log('Cerrando el servidor....');
  server.close(() => {
    console.log('Servidor http detenido');
    pool.end()
    .then(() => {
      console.log('\u001b[36m\u001b[1mConexion a la base de datos terminada\u001b[0m\n')
      process.exit(0)
    })
  });
});

but when I call pool.end() it just doesn't return to execute what's in the .then ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions