Commit 5aee0d23625a6a3e76d940b73859193dfee71bee

Authored by Adhidarma Hadiwinoto
1 parent 0d4216a3e9
Exists in master

coba lagi bro

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

... ... @@ -13,6 +13,7 @@ var redisClient;
13 13  
14 14 var xmlBuilder = new xml2js.Builder();
15 15 var taskHistory = LRU({max: 500, maxAge: 1000 * 3600 * 2});
  16 +var alreadyPending = LRU({max: 500, maxAge: 1000 * 3600 * 2});
16 17  
17 18 function start(options) {
18 19 if (!options) {
... ... @@ -198,12 +199,16 @@ function callbackReport(requestId, responseCode, msg, rawResponse, dontResendDel
198 199 });
199 200 }
200 201  
201   - _callbackReport(requestId, responseCode, msg, null, rawResponse);
  202 + if (!alreadyPending.get(requestId) || responseCode != '68') {
  203 + _callbackReport(requestId, responseCode, msg, null, rawResponse);
  204 + }
  205 + alreadyPending.set(requestId, '68');
202 206 }
203 207  
204 208 function getSnFromMessage(msg) {
205 209 try {
206 210 var matches = msg.match(/SN:\s*(\d+)/);
  211 + console.log(JSON.stringify(matches));
207 212 return matches[1];
208 213 }
209 214 catch(e) {