Commit 87762e48b7e03ae9cdb534f6f376290c759266af

Authored by Adhidarma Hadiwinoto
1 parent e15b050ee4
Exists in master

PULL: matrix.pending_with_response_tasks

Showing 1 changed file with 14 additions and 0 deletions Side-by-side Diff

... ... @@ -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;
... ... @@ -96,6 +100,10 @@ function putTaskToMatrix(task) {
96 100 if (matrix.sdk_pending_tasks.indexOf(task.trx_id) < 0) {
97 101 matrix.sdk_pending_tasks.push(task.trx_id);
98 102 }
  103 +
  104 + if (matrix.sdk_pending_with_response_tasks.indexOf(task.trx_id) < 0) {
  105 + matrix.sdk_pending_with_response_tasks.push(task.trx_id);
  106 + }
99 107 }
100 108  
101 109 function updateTaskOnMatrix(trx_id, rc) {
... ... @@ -105,6 +113,12 @@ function updateTaskOnMatrix(trx_id, rc) {
105 113 }
106 114  
107 115 if (rc === '68') {
  116 +
  117 + const pending_with_response_tasks_idx = matrix.sdk_pending_with_response_tasks.indexOf(trx_id);
  118 + if (pending_with_response_tasks_idx >= 0) {
  119 + matrix.sdk_pending_with_response_tasks.splice(pending_with_response_tasks_idx, 1)
  120 + }
  121 +
108 122 return;
109 123 }
110 124