Commit b2d7e7957de1dfea07e2825f9f1626b2cfb0e8e0

Authored by Adhidarma Hadiwinoto
1 parent 452ab95796
Exists in master

task pada callbackReport

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

... ... @@ -41,13 +41,18 @@ function start(options) {
41 41 }
42 42  
43 43 function callbackReport(requestId, rc, message, options) {
  44 + aaa.callbackReportWithPushToMongoDb(requestId, rc, message);
  45 +
  46 + if (!options.task) {
  47 + return;
  48 + }
  49 +
44 50 if (rc == '68') {
45 51 resendDelay.register(options.task);
46 52 } else {
47 53 resendDelay.cancel(options.task)
48 54 }
49 55  
50   - aaa.callbackReportWithPushToMongoDb(requestId, rc, message);
51 56 }
52 57  
53 58 function splitRemoteProduct(remoteProduct) {
... ... @@ -173,12 +178,12 @@ function topupAdvice(task) {
173 178  
174 179 if (body.trim() == 'invalid specs') {
175 180 logger.warn('Invalid specs', {task: task, responseBody: body});
176   - callbackReport(task.requestId, '68', body);
  181 + callbackReport(task.requestId, '68', body, {task: task});
177 182 return;
178 183 }
179 184 else if (body.trim() == 'data tidak ditemukan') {
180 185 logger.warn(body, {task: task, responseBody: body});
181   - callbackReport(task.requestId, '40', body);
  186 + callbackReport(task.requestId, '40', body, {task: task});
182 187 return;
183 188 }
184 189