Don't unsubscribe on Blockstream errors
This commit is contained in:
@@ -74,7 +74,7 @@ export class EventWatcher {
|
|||||||
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
|
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
|
||||||
this._reconcileBlockAsync.bind(this),
|
this._reconcileBlockAsync.bind(this),
|
||||||
this._pollingIntervalMs,
|
this._pollingIntervalMs,
|
||||||
this._onReconcileBlockError.bind(this, callback),
|
EventWatcher._onBlockAndLogStreamerError.bind(this, callback),
|
||||||
);
|
);
|
||||||
let isRemoved = false;
|
let isRemoved = false;
|
||||||
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
|
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
|
||||||
@@ -85,10 +85,6 @@ export class EventWatcher {
|
|||||||
this._onLogStateChangedAsync.bind(this, callback, isRemoved),
|
this._onLogStateChangedAsync.bind(this, callback, isRemoved),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
private _onReconcileBlockError(callback: EventWatcherCallback, err: Error): void {
|
|
||||||
this.unsubscribe();
|
|
||||||
callback(err);
|
|
||||||
}
|
|
||||||
private async _onLogStateChangedAsync(
|
private async _onLogStateChangedAsync(
|
||||||
callback: EventWatcherCallback,
|
callback: EventWatcherCallback,
|
||||||
isRemoved: boolean,
|
isRemoved: boolean,
|
||||||
|
|||||||
@@ -233,7 +233,6 @@ export class OrderWatcher {
|
|||||||
if (!_.isNull(err)) {
|
if (!_.isNull(err)) {
|
||||||
if (!_.isUndefined(this._callbackIfExists)) {
|
if (!_.isUndefined(this._callbackIfExists)) {
|
||||||
this._callbackIfExists(err);
|
this._callbackIfExists(err);
|
||||||
this.unsubscribe();
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user