Invoking async methods in synchronous event handlers (see example below) can lead to unhandled rejections which can trigger fatal application restarts.
if (this.config.acknowledge.timeoutSeconds > 0 && enable)
this.checkStandbyStatusTimer = setInterval(async () => {
if (this._stop)
return;
if (this._lastLsn &&
Date.now() - this.lastStandbyStatusUpdatedTime > this.config.acknowledge.timeoutSeconds * 1000)
await this.acknowledge(this._lastLsn);
}, 1000);
Any async handler should catch all exceptions or avoid async and ensure the invoked promise has a catch handler.
Invoking async methods in synchronous event handlers (see example below) can lead to unhandled rejections which can trigger fatal application restarts.
Any
asynchandler should catch all exceptions or avoid async and ensure the invoked promise has acatchhandler.