Compare View
Commits (3)
Changes
Showing 3 changed files Side-by-side Diff
gateway/pull.js
| ... | ... | @@ -15,6 +15,7 @@ const MAX_SLEEP_BEFORE_RESEND_MS = 500; |
| 15 | 15 | const DELAY_AFTER_NO_TASK_MS = 500; |
| 16 | 16 | |
| 17 | 17 | let is_on_delay_after_no_task = false; |
| 18 | +let pullTaskLocked = false; | |
| 18 | 19 | |
| 19 | 20 | if (config.handler_name) { |
| 20 | 21 | process.title = "KOMODO-GW@" + config.handler_name; |
| ... | ... | @@ -56,6 +57,11 @@ function pullTask() { |
| 56 | 57 | return; |
| 57 | 58 | } |
| 58 | 59 | |
| 60 | + if (pullTaskLocked) { | |
| 61 | + return; | |
| 62 | + } | |
| 63 | + pullTaskLocked = true; | |
| 64 | + | |
| 59 | 65 | if (is_on_delay_after_no_task && !config.disable_delay_after_no_task) { |
| 60 | 66 | return; |
| 61 | 67 | } |
| ... | ... | @@ -97,6 +103,8 @@ function pullTask() { |
| 97 | 103 | |
| 98 | 104 | const start_time = new Date(); |
| 99 | 105 | request(options, function(error, response, body) { |
| 106 | + pullTaskLocked = false; | |
| 107 | + | |
| 100 | 108 | const lame_limit = 10 * 1000; |
| 101 | 109 | if ((new Date() - start_time) > lame_limit) { |
| 102 | 110 | logger.warn('LAME-PULL: PULL response from CORE exceeds ' + lame_limit + ' secs'); |
package-lock.json