aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher/src/order_watcher
diff options
context:
space:
mode:
authoramaurer <git@maurer.me>2018-10-06 22:06:34 +0800
committeramaurer <git@maurer.me>2018-10-06 22:06:34 +0800
commitbd3f101ab8735f97646d1031126fb9e55b67a93d (patch)
treed5c9335b84c185dd80f7ad5a13fc8a044682088a /packages/order-watcher/src/order_watcher
parent119f8c94495a15ef43298a77abc87fb9d33b4bb3 (diff)
downloaddexon-sol-tools-bd3f101ab8735f97646d1031126fb9e55b67a93d.tar
dexon-sol-tools-bd3f101ab8735f97646d1031126fb9e55b67a93d.tar.gz
dexon-sol-tools-bd3f101ab8735f97646d1031126fb9e55b67a93d.tar.bz2
dexon-sol-tools-bd3f101ab8735f97646d1031126fb9e55b67a93d.tar.lz
dexon-sol-tools-bd3f101ab8735f97646d1031126fb9e55b67a93d.tar.xz
dexon-sol-tools-bd3f101ab8735f97646d1031126fb9e55b67a93d.tar.zst
dexon-sol-tools-bd3f101ab8735f97646d1031126fb9e55b67a93d.zip
Added orderWatchCount to return total count of orders watched.
Diffstat (limited to 'packages/order-watcher/src/order_watcher')
-rw-r--r--packages/order-watcher/src/order_watcher/order_watcher.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts
index f9a63efe3..9b2999285 100644
--- a/packages/order-watcher/src/order_watcher/order_watcher.ts
+++ b/packages/order-watcher/src/order_watcher/order_watcher.ts
@@ -213,6 +213,9 @@ export class OrderWatcher {
this._expirationWatcher.unsubscribe();
intervalUtils.clearAsyncExcludingInterval(this._cleanupJobIntervalIdIfExists);
}
+ public getWatchCount(): number {
+ return _.size(this._orderByOrderHash);
+ }
private async _cleanupAsync(): Promise<void> {
for (const orderHash of _.keys(this._orderByOrderHash)) {
this._cleanupOrderRelatedState(orderHash);