diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-06 04:25:47 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-07-06 04:25:47 +0800 |
commit | abb38e1bc05889a145ab91177609a11ab469c187 (patch) | |
tree | 35d8a45df1634a5f4d9b862c74017e1ddae7680c /packages/order-watcher/src | |
parent | 0df36471b7f6dd53c4aa3c1d34b88e904b15c35f (diff) | |
download | dexon-sol-tools-abb38e1bc05889a145ab91177609a11ab469c187.tar.gz dexon-sol-tools-abb38e1bc05889a145ab91177609a11ab469c187.tar.zst dexon-sol-tools-abb38e1bc05889a145ab91177609a11ab469c187.zip |
Don't unsubscribe on Blockstream errors
Diffstat (limited to 'packages/order-watcher/src')
-rw-r--r-- | packages/order-watcher/src/order_watcher/event_watcher.ts | 6 | ||||
-rw-r--r-- | packages/order-watcher/src/order_watcher/order_watcher.ts | 1 |
2 files changed, 1 insertions, 6 deletions
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; } |