Tidy + some logging
This commit is contained in:
parent
ec994211e0
commit
59ee52ea6f
|
@ -2287,13 +2287,18 @@ FTNMessageScanTossModule.prototype.shutdown = function(cb) {
|
||||||
|
|
||||||
FTNMessageScanTossModule.prototype.performImport = function(cb) {
|
FTNMessageScanTossModule.prototype.performImport = function(cb) {
|
||||||
if(!this.hasValidConfiguration()) {
|
if(!this.hasValidConfiguration()) {
|
||||||
return cb(new Error('Missing or invalid configuration'));
|
return cb(Errors.MissingConfig('Invalid or missing configuration'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
async.each( [ 'inbound', 'secInbound' ], (inboundType, nextDir) => {
|
async.each( [ 'inbound', 'secInbound' ], (inboundType, nextDir) => {
|
||||||
self.importFromDirectory(inboundType, self.moduleConfig.paths[inboundType], () => {
|
const importDir = self.moduleConfig.paths[inboundType];
|
||||||
|
self.importFromDirectory(inboundType, importDir, err => {
|
||||||
|
if (err) {
|
||||||
|
Log.warn({ importDir, error : err.message }, 'Error(s) during import');
|
||||||
|
}
|
||||||
|
|
||||||
return nextDir(null);
|
return nextDir(null);
|
||||||
});
|
});
|
||||||
}, cb);
|
}, cb);
|
||||||
|
@ -2305,7 +2310,7 @@ FTNMessageScanTossModule.prototype.performExport = function(cb) {
|
||||||
// and let's find out what messages need exported.
|
// and let's find out what messages need exported.
|
||||||
//
|
//
|
||||||
if(!this.hasValidConfiguration()) {
|
if(!this.hasValidConfiguration()) {
|
||||||
return cb(new Error('Missing or invalid configuration'));
|
return cb(Errors.MissingConfig('Invalid or missing configuration'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
@ -2313,7 +2318,7 @@ FTNMessageScanTossModule.prototype.performExport = function(cb) {
|
||||||
async.eachSeries( [ 'EchoMail', 'NetMail' ], (type, nextType) => {
|
async.eachSeries( [ 'EchoMail', 'NetMail' ], (type, nextType) => {
|
||||||
self[`perform${type}Export`]( err => {
|
self[`perform${type}Export`]( err => {
|
||||||
if(err) {
|
if(err) {
|
||||||
Log.warn( { error : err.message, type : type }, 'Error(s) during export' );
|
Log.warn( { type, error : err.message }, 'Error(s) during export' );
|
||||||
}
|
}
|
||||||
return nextType(null); // try next, always
|
return nextType(null); // try next, always
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue