Commit 543db86435855acfd80235d2022f655f3767c905
1 parent
e9d3b8b13b
Exists in
master
insertTaskToMongoDb dan callbackReportWithPushToMongoDb
Showing 2 changed files with 22 additions and 7 deletions Side-by-side Diff
gentong.js
... | ... | @@ -41,6 +41,8 @@ function generateTimestamp(request_id) { |
41 | 41 | } |
42 | 42 | |
43 | 43 | function topupRequest(task) { |
44 | + aaa.insertTaskToMongoDb(task); | |
45 | + | |
44 | 46 | var ts = strftime('%F %T', new Date()); |
45 | 47 | ts = generateTimestamp(task['requestId']); |
46 | 48 | |
... | ... | @@ -354,15 +356,28 @@ function responseCodeFromMessage(message) { |
354 | 356 | return; |
355 | 357 | } |
356 | 358 | |
357 | -function start(_config, _callbackReport, options) { | |
358 | - config = _config; | |
359 | - callbackReport = _callbackReport | |
359 | +function start(options) { | |
360 | + if (!options) { | |
361 | + console.log('Undefined options, terminating....'); | |
362 | + process.exit(1); | |
363 | + } | |
364 | + | |
365 | + if (options.config) { | |
366 | + config = options.config; | |
367 | + } else { | |
368 | + console.log('Undefined options.config, terminating....') | |
369 | + process.exit(1); | |
370 | + } | |
360 | 371 | |
361 | - if (options && options.aaa) { | |
362 | - aaa = options.aaa; | |
372 | + if (options.aaa) { | |
373 | + aaa = options.aaa; | |
374 | + callbackReport = options.aaa.callbackReportWithPushToMongoDb; | |
375 | + } else { | |
376 | + console.log('Undefined options.aaa, terminating....') | |
377 | + process.exit(1); | |
363 | 378 | } |
364 | 379 | |
365 | - if (options && options.logger) { | |
380 | + if (options.logger) { | |
366 | 381 | logger = options.logger; |
367 | 382 | } else { |
368 | 383 | logger = new winston.Logger({ |
index.js