Commit ccfa3bee6eb675ca8bc0e23cf9230566acdc75ce

Authored by Adhidarma Hadiwinoto
1 parent c2f91b248c
Exists in master

resendDelay.isEnabled

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

gateway/resend-delay.js
... ... @@ -11,6 +11,10 @@ const resendHandlers = LRU({
11 11 maxAge: 1000 * 3600 * 24
12 12 });
13 13  
  14 +function isEnabled() {
  15 + return config && config.auto_resend && Number(config.auto_resend.delay_ms) && Number(config.auto_resend.max_retry);
  16 +}
  17 +
14 18 function _resend(task, request) {
15 19 const trx_date = moment(task.created).format('YYYYMMDD');
16 20 if (trx_date !== moment().format('YYYYMMDD')) {
... ... @@ -82,3 +86,4 @@ setInterval(
82 86  
83 87 exports.cancel = cancel;
84 88 exports.register = register;
  89 +exports.isEnabled = isEnabled;