Compare View
Commits (2)
Changes
Showing 3 changed files Side-by-side Diff
gateway/pull.js
... | ... | @@ -10,6 +10,8 @@ const heartbeat = require('../heartbeat'); |
10 | 10 | |
11 | 11 | const taskArchive = require('./task-archive'); |
12 | 12 | |
13 | +const MAX_SLEEP_BEFORE_RESEND_MS = 500; | |
14 | + | |
13 | 15 | if (config.handler_name) { |
14 | 16 | process.title = "KOMODO-GW@" + config.handler_name; |
15 | 17 | } |
... | ... | @@ -148,9 +150,11 @@ function report(data) { |
148 | 150 | request.post(options, function(error, response, body) { |
149 | 151 | if (error) { |
150 | 152 | logger.warn('Error reporting to CORE', {error: error}); |
153 | + resendReport(data); | |
151 | 154 | } |
152 | 155 | else if (response.statusCode != 200) { |
153 | - logger.warn('CORE http response status is not 200', {requestOptions: options, http_response_status: response.statusCode}); | |
156 | + logger.warn('Error reporting to CORE, http response status is not 200', {requestOptions: options, http_response_status: response.statusCode}); | |
157 | + resendReport(data); | |
154 | 158 | } |
155 | 159 | else if (!config.do_not_verbose_log_report) { |
156 | 160 | logger.verbose('Report has been sent to CORE', {requestOptions: options}); |
... | ... | @@ -159,7 +163,7 @@ function report(data) { |
159 | 163 | } |
160 | 164 | |
161 | 165 | function resendReport(data) { |
162 | - let sleepBeforeResend = 1000; | |
166 | + const sleepBeforeResend = Math.round(Math.random() * MAX_SLEEP_BEFORE_RESEND_MS) | |
163 | 167 | logger.verbose('Resend report to CORE in ' + sleepBeforeResend + 'ms') |
164 | 168 | |
165 | 169 | setTimeout( |
misc/product-sort.js
package.json
1 | 1 | { |
2 | 2 | "name": "komodo-sdk", |
3 | - "version": "1.14.4", | |
3 | + "version": "1.14.5", | |
4 | 4 | "description": "SDK for Komodo", |
5 | 5 | "main": "index.js", |
6 | 6 | "scripts": { |
... | ... | @@ -25,6 +25,7 @@ |
25 | 25 | "express-session": "^1.15.6", |
26 | 26 | "lru-cache": "^4.1.1", |
27 | 27 | "moment": "^2.19.1", |
28 | + "node-natural-sort": "^0.8.6", | |
28 | 29 | "numeral": "^2.0.6", |
29 | 30 | "nunjucks": "^3.0.1", |
30 | 31 | "redis": "^2.8.0", |