Don't unsubscribe on Blockstream errors

This commit is contained in:
Fabio Berger
2018-07-05 22:25:47 +02:00
parent 0df36471b7
commit abb38e1bc0
2 changed files with 1 additions and 6 deletions

View File

@@ -74,7 +74,7 @@ export class EventWatcher {
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
this._reconcileBlockAsync.bind(this),
this._pollingIntervalMs,
this._onReconcileBlockError.bind(this, callback),
EventWatcher._onBlockAndLogStreamerError.bind(this, callback),
);
let isRemoved = false;
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
@@ -85,10 +85,6 @@ export class EventWatcher {
this._onLogStateChangedAsync.bind(this, callback, isRemoved),
);
}
private _onReconcileBlockError(callback: EventWatcherCallback, err: Error): void {
this.unsubscribe();
callback(err);
}
private async _onLogStateChangedAsync(
callback: EventWatcherCallback,
isRemoved: boolean,

View File

@@ -233,7 +233,6 @@ export class OrderWatcher {
if (!_.isNull(err)) {
if (!_.isUndefined(this._callbackIfExists)) {
this._callbackIfExists(err);
this.unsubscribe();
}
return;
}