Compare View
Commits (5)
Changes
Showing 2 changed files Side-by-side Diff
gateway/pull.js
... | ... | @@ -24,6 +24,10 @@ if (!matrix.active_tasks) { |
24 | 24 | matrix.sdk_unresponsed_tasks = []; |
25 | 25 | } |
26 | 26 | |
27 | +if (!matrix.pending_with_response_tasks) { | |
28 | + matrix.sdk_pending_with_response_tasks = []; | |
29 | +} | |
30 | + | |
27 | 31 | heartbeat.setModuleType('gateway'); |
28 | 32 | |
29 | 33 | var partner; |
... | ... | @@ -54,7 +58,8 @@ function pullTask() { |
54 | 58 | url: core_pull_task_url, |
55 | 59 | qs: { |
56 | 60 | handler: config.handler_name, |
57 | - products: config.products.join(',') | |
61 | + products: config.products.join(','), | |
62 | + advice_url: (config && config.push_server && config.push_server.apikey && config.push_server.advice && config.push_server.advice.url && config.push_server.advice.port) ? config.push_server.advice.url : null | |
58 | 63 | } |
59 | 64 | } |
60 | 65 | |
... | ... | @@ -96,6 +101,10 @@ function putTaskToMatrix(task) { |
96 | 101 | if (matrix.sdk_pending_tasks.indexOf(task.trx_id) < 0) { |
97 | 102 | matrix.sdk_pending_tasks.push(task.trx_id); |
98 | 103 | } |
104 | + | |
105 | + if (matrix.sdk_pending_with_response_tasks.indexOf(task.trx_id) < 0) { | |
106 | + matrix.sdk_pending_with_response_tasks.push(task.trx_id); | |
107 | + } | |
99 | 108 | } |
100 | 109 | |
101 | 110 | function updateTaskOnMatrix(trx_id, rc) { |
... | ... | @@ -105,6 +114,12 @@ function updateTaskOnMatrix(trx_id, rc) { |
105 | 114 | } |
106 | 115 | |
107 | 116 | if (rc === '68') { |
117 | + | |
118 | + const pending_with_response_tasks_idx = matrix.sdk_pending_with_response_tasks.indexOf(trx_id); | |
119 | + if (pending_with_response_tasks_idx >= 0) { | |
120 | + matrix.sdk_pending_with_response_tasks.splice(pending_with_response_tasks_idx, 1); | |
121 | + } | |
122 | + | |
108 | 123 | return; |
109 | 124 | } |
110 | 125 | |
... | ... | @@ -141,7 +156,7 @@ function forwardCoreTaskToPartner(coreMessage) { |
141 | 156 | } |
142 | 157 | |
143 | 158 | function replaceRc(original_rc) { |
144 | - if (!config || !config.replace_rc || !config.replace_rc.length) { | |
159 | + if (!config || !config.replace_rc) { | |
145 | 160 | return original_rc; |
146 | 161 | } |
147 | 162 |