Commit f83cb69da77118ad67d088684d933e64bf8daa2e
1 parent
e343388d00
Exists in
master
pengecekan config.auto_resend
Showing 1 changed file with 11 additions and 11 deletions Side-by-side Diff
partner.js
... | ... | @@ -80,17 +80,17 @@ function _requestToPartner(task, pendingOnError) { |
80 | 80 | function reportToCore(data) { |
81 | 81 | pull.report(data); |
82 | 82 | |
83 | - let delay = 60 * 1000; | |
84 | - if (config.auto_resend.delay_ms) { | |
85 | - delay = Number(config.auto_resend.delay_ms); | |
86 | - } | |
87 | - | |
88 | - let max_retry = 60; | |
89 | - if (config.auto_resend.max_retry) { | |
90 | - max_retry = Number(config.auto_resend.max_retry); | |
91 | - } | |
92 | - | |
93 | 83 | if (data && data.task && data.rc == '68') { |
84 | + let delay_ms = 60 * 1000; | |
85 | + if (config.auto_resend && config.auto_resend.delay_ms) { | |
86 | + delay_ms = Number(config.auto_resend.delay_ms); | |
87 | + } | |
88 | + | |
89 | + let max_retry = 60; | |
90 | + if (config.auto_resend && config.auto_resend.max_retry) { | |
91 | + max_retry = Number(config.auto_resend.max_retry); | |
92 | + } | |
93 | + | |
94 | 94 | setTimeout( |
95 | 95 | function() { |
96 | 96 | |
... | ... | @@ -106,7 +106,7 @@ function reportToCore(data) { |
106 | 106 | logger.verbose('Exceeding retry pending status', {task: data.task}); |
107 | 107 | } |
108 | 108 | }, |
109 | - delay | |
109 | + delay_ms | |
110 | 110 | ) |
111 | 111 | } |
112 | 112 | } |