aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/request.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/request.js b/server/models/request.js
index 7fdf5bd31..248ab3303 100644
--- a/server/models/request.js
+++ b/server/models/request.js
@@ -102,7 +102,7 @@ function makeRequest (toPod, requestsToMake, callback) {
102function makeRequests () { 102function makeRequests () {
103 const self = this 103 const self = this
104 104
105 list.call(self, function (err, requests) { 105 listWithLimit.call(self, constants.REQUESTS_LIMIT, function (err, requests) {
106 if (err) { 106 if (err) {
107 logger.error('Cannot get the list of requests.', { err: err }) 107 logger.error('Cannot get the list of requests.', { err: err })
108 return // Abort 108 return // Abort
@@ -269,8 +269,8 @@ function updatePodsScore (goodPods, badPods) {
269 }) 269 })
270} 270}
271 271
272function list (callback) { 272function listWithLimit (limit, callback) {
273 this.find({ }, { _id: 1, request: 1, to: 1 }).sort({ _id: 1 }).exec(callback) 273 this.find({ }, { _id: 1, request: 1, to: 1 }).sort({ _id: 1 }).limit(limit).exec(callback)
274} 274}
275 275
276function removeAll (callback) { 276function removeAll (callback) {