Commit 73b3251b53d02dc17d6e41e4c191c25cb52ff9a6

Authored by Adhidarma Hadiwinoto
1 parent b7086545bf
Exists in master

gunakan anti-same-day-dupe-oo

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

... ... @@ -7,7 +7,8 @@ var http = require('http');
7 7  
8 8 var resendDelay = require('sate24/resend-delay');
9 9 var taskHistory = require('sate24/task-history');
10   -var antiSameDayDupe = require('sate24/anti-same-day-dupe');
  10 +var AntiSameDayDupe = require('sate24/anti-same-day-dupe-oo');
  11 +var antiSameDayDupe;
11 12  
12 13 var config;
13 14 var aaa;
... ... @@ -78,6 +79,16 @@ function topupRequest(task) {
78 79 }
79 80  
80 81 aaa.insertTaskToMongoDb(task);
  82 +
  83 + if (!antiSameDayDupe) {
  84 + logger.info('Initializing antiSameDayDupe');
  85 + antiSameDayDupe = new AntiSameDayDupe({
  86 + config: config,
  87 + logger: logger,
  88 + keyPrefix: 'otomax.',
  89 + redisClient: redisClient
  90 + });
  91 + }
81 92 antiSameDayDupe.check(task, _topupRequest, onSameDayDupe, checkStatus);
82 93 }
83 94