Commit e54de6da037292b3f6b66f38bf42a7be0f9ff8d5

Authored by Adhidarma Hadiwinoto
1 parent 5735fb277d
Exists in master

perbaikan dan debug resend delay

Showing 1 changed file with 15 additions and 4 deletions Side-by-side Diff

... ... @@ -185,13 +185,24 @@ function report(data) {
185 185 matrix.last_report_to_core = data;
186 186 pull.report(data);
187 187  
188   - if (!resendDelay.isEnabled()) return;
  188 + if (!data.task) {
  189 + return;
  190 + }
  191 +
  192 + const task = data.task;
  193 +
  194 + if (!resendDelay.isEnabled()) {
  195 + logger.verbose('Skipping resend delay because resend delay has not configured yet', {trx_id: task.trx_id, destination: task.destination, product: task.product});
  196 + return;
  197 + }
189 198  
190   - if (data.task && data.rc && data.rc === '68') {
191   - resendDelay.register(data.task, advice);
  199 + if (data.rc && data.rc === '68') {
  200 + logger.verbose('Registering resend delay', {trx_id: task.trx_id, destination: task.destination, product: task.product})
  201 + resendDelay.register(task, advice);
192 202 }
193 203 else {
194   - resendDelay.cancel(data.trx_id);
  204 + logger.verbose('Canceling resend delay', {trx_id: task.trx_id, destination: task.destination, product: task.product})
  205 + resendDelay.cancel(task.trx_id);
195 206 }
196 207 }
197 208