Fescobalt

On server shutdown event

Recommended Posts

Hi! Guys, I need some help with JS events (server-side). I would to end mysql connection but I dont found any server terminate (server exit, server terminate, e.g.) event at wiki. Can sb help me? How can I close my mysql connection on server shutdown?

Share this post


Link to post
Share on other sites
13 минуты назад, Captien сказал:

Use nodeJS process events events example:
 

process.on("exit", (code) => {
    console.log(`Exiting the process with code of ${code}!`);
});

 

Thank you for answer. You really helped me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.