rodrigogs / mysql-events

A node package that watches a MySQL database and runs callbacks on matched events.
BSD 3-Clause "New" or "Revised" License
136 stars 52 forks source link

Retry after Database connection lost #17

Closed iamchathu closed 5 years ago

iamchathu commented 5 years ago

Is there anyway to auto reconnect after disconnect

rodrigogs commented 5 years ago

Unfortunately, no. You could use a connection pool or manage to restart your instance on disconnection.

instance.on(MySQLEvents.EVENTS.CONNECTION_ERROR, (err) => {
  // handle me
});