From 83d0bad3a1e6635dedb46fbd99ee1bec5246d4bf Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 5 Feb 2018 16:28:03 -0800 Subject: Addressed comments and update 0xProject/types-ethereumjs-util deps --- packages/testnet-faucets/src/ts/request_queue.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/testnet-faucets/src/ts/request_queue.ts') diff --git a/packages/testnet-faucets/src/ts/request_queue.ts b/packages/testnet-faucets/src/ts/request_queue.ts index 7d685522a..718f8be0c 100644 --- a/packages/testnet-faucets/src/ts/request_queue.ts +++ b/packages/testnet-faucets/src/ts/request_queue.ts @@ -13,14 +13,12 @@ const DEFAULT_QUEUE_INTERVAL_MS = 1000; export class RequestQueue { protected _queueIntervalMs: number; protected _queue: string[]; - protected _queueIntervalId: NodeJS.Timer; + protected _queueIntervalId?: NodeJS.Timer; protected _web3: Web3; constructor(web3: any) { this._queueIntervalMs = DEFAULT_QUEUE_INTERVAL_MS; this._queue = []; - this._web3 = web3; - this._start(); } public add(recipientAddress: string): boolean { @@ -47,7 +45,9 @@ export class RequestQueue { }, this._queueIntervalMs); } protected _stop() { - clearInterval(this._queueIntervalId); + if (!_.isUndefined(this._queueIntervalId)) { + clearInterval(this._queueIntervalId); + } } // tslint:disable-next-line:prefer-function-over-method protected async _processNextRequestFireAndForgetAsync(recipientAddress: string) { -- cgit