aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/request.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/server/models/request.js b/server/models/request.js
index 4e510e18a..b36b4f613 100644
--- a/server/models/request.js
+++ b/server/models/request.js
@@ -96,7 +96,14 @@ function makeRequest (toPod, requestsToMake, callback) {
96 // The function fire some useful callbacks 96 // The function fire some useful callbacks
97 requests.makeSecureRequest(params, function (err, res) { 97 requests.makeSecureRequest(params, function (err, res) {
98 if (err || (res.statusCode !== 200 && res.statusCode !== 201 && res.statusCode !== 204)) { 98 if (err || (res.statusCode !== 200 && res.statusCode !== 201 && res.statusCode !== 204)) {
99 logger.error('Error sending secure request to %s pod.', toPod.url, { error: err || new Error('Status code not 20x') }) 99 logger.error(
100 'Error sending secure request to %s pod.',
101 toPod.url,
102 {
103 error: err || new Error('Status code not 20x'),
104 statusCode: res.statusCode
105 }
106 )
100 107
101 return callback(false) 108 return callback(false)
102 } 109 }
@@ -160,12 +167,6 @@ function makeRequests () {
160 } 167 }
161 168
162 makeRequest(toPod, requestToMake.datas, function (success) { 169 makeRequest(toPod, requestToMake.datas, function (success) {
163 if (err) {
164 logger.error('Errors when sent request to %s.', toPod.url, { error: err })
165 // Do not stop the process just for one error
166 return callbackEach()
167 }
168
169 if (success === true) { 170 if (success === true) {
170 logger.debug('Removing requests for %s pod.', toPodId, { requestsIds: requestToMake.ids }) 171 logger.debug('Removing requests for %s pod.', toPodId, { requestsIds: requestToMake.ids })
171 172