aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-07-06 19:59:01 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-07-06 19:59:01 +0200
commitb359546358c39b839867ca920e10221979c65424 (patch)
tree03d9f57d9480ac4fba5d5f7ccf0f1311c92faafc /server/models/request.js
parent4fea95df04738290232bdc51696fb2233aa1a65e (diff)
downloadPeerTube-b359546358c39b839867ca920e10221979c65424.tar.gz
PeerTube-b359546358c39b839867ca920e10221979c65424.tar.zst
PeerTube-b359546358c39b839867ca920e10221979c65424.zip
Server: limit actions for each request between pods
Diffstat (limited to 'server/models/request.js')
-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) {