From abb38e1bc05889a145ab91177609a11ab469c187 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 5 Jul 2018 22:25:47 +0200 Subject: Don't unsubscribe on Blockstream errors --- packages/order-watcher/src/order_watcher/event_watcher.ts | 6 +----- packages/order-watcher/src/order_watcher/order_watcher.ts | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/src/order_watcher/event_watcher.ts b/packages/order-watcher/src/order_watcher/event_watcher.ts index 9a4089384..0e27cd64b 100644 --- a/packages/order-watcher/src/order_watcher/event_watcher.ts +++ b/packages/order-watcher/src/order_watcher/event_watcher.ts @@ -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, diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 0ee56592e..b28e9bc37 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -233,7 +233,6 @@ export class OrderWatcher { if (!_.isNull(err)) { if (!_.isUndefined(this._callbackIfExists)) { this._callbackIfExists(err); - this.unsubscribe(); } return; } -- cgit