title: Call a function before server restart Node/Express
body: <p>I'm pooling with mysql and would like to end the connection if the server goes down.</p>
  
  <p>The reason I'm doing this is that if the server is offline, the connection pool processes are still there, giving me a max_user_connections error when reconnecting.</p>
  
  <p>I'm using connection.release() but apparently it is not good enough.</p>
  
  <p>Is there a way to do this or a better solution for doing this?</p>
  
  <p>Thanks!</p>