historical-deadletter-processor
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -16,3 +16,3 @@ (function() { | ||
module.exports = HistoricalDeadletterProcessor = (function() { | ||
function HistoricalDeadletterProcessor(processor, arg, concurrency) { | ||
function HistoricalDeadletterProcessor(processor, arg, concurrency, logger) { | ||
var connection; | ||
@@ -23,4 +23,5 @@ this.processor = processor; | ||
callsToApi: 20, | ||
callsToProcessor: 50 | ||
callsToAzure: 50 | ||
}; | ||
this.logger = logger != null ? logger : console; | ||
this._remove = bind(this._remove, this); | ||
@@ -40,5 +41,11 @@ this._doProcess = bind(this._doProcess, this); | ||
return function(row) { | ||
return _this._doProcess(row).map(function() { | ||
var RowKey; | ||
RowKey = row.RowKey; | ||
return _this._doProcess(row).tap(function() { | ||
return this.logger.info("Process successful " + RowKey); | ||
}).map(function() { | ||
return row; | ||
}).errors(function() {}); | ||
}).errors(function() { | ||
return _this.logger.warn("Still fails " + RowKey); | ||
}); | ||
}; | ||
@@ -49,3 +56,3 @@ })(this)).parallel(this.concurrency.callsToApi).map((function(_this) { | ||
}; | ||
})(this)).parallel(this.concurrency.callsToProcessor).collect().toPromise(Promise); | ||
})(this)).parallel(this.concurrency.callsToAzure).collect().toPromise(Promise); | ||
}; | ||
@@ -71,2 +78,5 @@ | ||
notification = arg.notification; | ||
this.logger.info("Processing", { | ||
notification: notification | ||
}); | ||
return highland(this.processor(notification)); | ||
@@ -73,0 +83,0 @@ }; |
{ | ||
"name": "historical-deadletter-processor", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "historical-deadletter-processor", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
23571
84