Commit 733cd34aeb76867a7b38508bc99c73e56bbeb1b8

Authored by Adhidarma Hadiwinoto
1 parent 5e82936a82
Exists in master

resendDelay

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

... ... @@ -4,6 +4,7 @@ const http = require('http');
4 4 http.globalAgent.maxSockets = Infinity;
5 5  
6 6 const request = require('request');
  7 +const resendDelay = require('./resend-delay')
7 8  
8 9 var config;
9 10 var aaa;
... ... @@ -35,9 +36,17 @@ function start(options) {
35 36 console.log('Undefined options.logger, terminating....')
36 37 process.exit(1);
37 38 }
  39 +
  40 + resendDelay.init({config: config, logger: logger, topupRequest: topupAdvice});
38 41 }
39 42  
40 43 function callbackReport(requestId, rc, message, options) {
  44 + if (rc == '68') {
  45 + resendDelay.register(options.task);
  46 + } else {
  47 + resendDelay.cancel(options.task)
  48 + }
  49 +
41 50 aaa.callbackReportWithPushToMongoDb(requestId, rc, message);
42 51 }
43 52