diff options
Diffstat (limited to 'server/lib/base-request-scheduler.js')
-rw-r--r-- | server/lib/base-request-scheduler.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/lib/base-request-scheduler.js b/server/lib/base-request-scheduler.js index 309c1a261..1c6b78297 100644 --- a/server/lib/base-request-scheduler.js +++ b/server/lib/base-request-scheduler.js | |||
@@ -12,6 +12,7 @@ module.exports = class BaseRequestScheduler { | |||
12 | constructor (options) { | 12 | constructor (options) { |
13 | this.lastRequestTimestamp = 0 | 13 | this.lastRequestTimestamp = 0 |
14 | this.timer = null | 14 | this.timer = null |
15 | this.requestInterval = constants.REQUESTS_INTERVAL | ||
15 | } | 16 | } |
16 | 17 | ||
17 | activate () { | 18 | activate () { |
@@ -21,7 +22,7 @@ module.exports = class BaseRequestScheduler { | |||
21 | this.timer = setInterval(() => { | 22 | this.timer = setInterval(() => { |
22 | this.lastRequestTimestamp = Date.now() | 23 | this.lastRequestTimestamp = Date.now() |
23 | this.makeRequests() | 24 | this.makeRequests() |
24 | }, constants.REQUESTS_INTERVAL) | 25 | }, this.requestInterval) |
25 | } | 26 | } |
26 | 27 | ||
27 | deactivate () { | 28 | deactivate () { |
@@ -41,6 +42,10 @@ module.exports = class BaseRequestScheduler { | |||
41 | return constants.REQUESTS_INTERVAL - (Date.now() - this.lastRequestTimestamp) | 42 | return constants.REQUESTS_INTERVAL - (Date.now() - this.lastRequestTimestamp) |
42 | } | 43 | } |
43 | 44 | ||
45 | remainingRequestsCount (callback) { | ||
46 | return this.getRequestModel().countTotalRequests(callback) | ||
47 | } | ||
48 | |||
44 | // --------------------------------------------------------------------------- | 49 | // --------------------------------------------------------------------------- |
45 | 50 | ||
46 | // Make a requests to friends of a certain type | 51 | // Make a requests to friends of a certain type |