From 6966e8e41c0588a1d6b3331637c21d690db299b6 Mon Sep 17 00:00:00 2001 From: Jeff McAffer Date: Thu, 29 Dec 2016 16:53:09 -0800 Subject: [PATCH] update for _emitter change --- lib/crawler.js | 2 +- lib/githubFetcher.js | 2 +- lib/queueSet.js | 2 +- test/crawlerTests.js | 2 +- test/githubFetcherTests.js | 2 +- test/queueSetTests.js | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/crawler.js b/lib/crawler.js index 7d0065f..8eac114 100644 --- a/lib/crawler.js +++ b/lib/crawler.js @@ -15,7 +15,7 @@ class Crawler { this.fetcher = fetcher; this.processor = processor; this.options = options; - this.options._emitter.on('changed', this._reconfigure.bind(this)); + this.options._config.on('changed', this._reconfigure.bind(this)); this.logger = options.logger; this.counter = 0; this.counterRollover = Number.parseInt('zzz', 36); diff --git a/lib/githubFetcher.js b/lib/githubFetcher.js index c5a69bd..e640748 100644 --- a/lib/githubFetcher.js +++ b/lib/githubFetcher.js @@ -12,7 +12,7 @@ class GitHubFetcher { this.tokenFactory = tokenFactory; this.options = options; this.logger = options.logger; - this.options._emitter.on('changed', this._reconfigure.bind(this)); + this.options._config.on('changed', this._reconfigure.bind(this)); this.getQueue = async.queue(this._callGitHubTask.bind(this), options.concurrency || 5); } diff --git a/lib/queueSet.js b/lib/queueSet.js index e67c2cf..9929d49 100644 --- a/lib/queueSet.js +++ b/lib/queueSet.js @@ -15,7 +15,7 @@ class QueueSet { } this.deadletter = deadletter; this.options = options; - this.options._emitter.on('changed', this._reconfigure.bind(this)); + this.options._config.on('changed', this._reconfigure.bind(this)); this.startMap = this._createStartMap(this.options.weights || [1]); this.popCount = 0; } diff --git a/test/crawlerTests.js b/test/crawlerTests.js index e62d462..7c314ba 100644 --- a/test/crawlerTests.js +++ b/test/crawlerTests.js @@ -1105,7 +1105,7 @@ function createBaseOptions(logger = createBaseLog()) { }; for (let name in result) { const subsystemOptions = result[name]; - subsystemOptions._emitter = { on: () => { } }; + subsystemOptions._config = { on: () => { } }; subsystemOptions.logger = logger; } return result; diff --git a/test/githubFetcherTests.js b/test/githubFetcherTests.js index 4e1f773..3f517e6 100644 --- a/test/githubFetcherTests.js +++ b/test/githubFetcherTests.js @@ -286,7 +286,7 @@ function createBaseOptions(logger = createBaseLog()) { return { fetcher: { logger: logger, - _emitter: { on: () => { } }, + _config: { on: () => { } }, tokenLowerBound: 50, forbiddenDelay: 120000 } diff --git a/test/queueSetTests.js b/test/queueSetTests.js index 8e1d5e4..6c18597 100644 --- a/test/queueSetTests.js +++ b/test/queueSetTests.js @@ -25,7 +25,7 @@ describe('QueueSet weighting', () => { }); it('should create a default startMap if no weights given', () => { - const set = new QueueSet([createBaseQueue('1'), createBaseQueue('2')], null, { _emitter: { on: () => { } } }); + const set = new QueueSet([createBaseQueue('1'), createBaseQueue('2')], null, { _config: { on: () => { } } }); expect(set.startMap.length).to.be.equal(1); expect(set.startMap[0]).to.be.equal(0); }); @@ -245,7 +245,7 @@ describe('QueueSet subscription management', () => { function createOptions(weights) { return { weights: weights, - _emitter: { on: () => { } } + _config: { on: () => { } } }; }