service.dispatch(req, res);
}).listen(PORT, ADDR, (err) => {
if (err) {
- logger.error(_scope, 'error starting server', err);
+ logger.error(_scope, 'error creating server', err);
throw err;
}
logger.info(_scope, 'server started', { version, listenAddress: ADDR, listenPort: PORT });
});
} catch (e) {
(logger || console).error(_scope, 'error starting server', e);
+ db && db.listener && await db.listener.stop();
}
})();
\ No newline at end of file
delete this.reconnectPending;
}
if (this.connection) {
- this.connection.client.removeListener(this.notificationEventName, this.onNotificationBound);
+ this.connection.client.removeListener(this.notificationEventName, this._onNotificationBound);
this.connection.done();
this.connection = null;
await this.options.connectionLostCallback();
this.logger.error(_scope, 'listener connection lost', { error, event });
this.connection = null;
try {
- event.client.removeListener(this.notificationEventName, this.onNotificationBound);
+ event.client.removeListener(this.notificationEventName, this._onNotificationBound);
} catch (e) {
this.logger.error(_scope, 'failed to remove listener', { error: e });
// That's okay, it was probably just gone anyhow.