Fix bug with FTN export scheduler

This commit is contained in:
Bryan Ashby 2017-02-21 21:26:56 -07:00
parent 3af1858c39
commit 4cea9e023a
1 changed files with 12 additions and 8 deletions

View File

@ -803,6 +803,9 @@ function FTNMessageScanTossModule() {
],
err => {
// :TODO: do something with |err| ?
if(err) {
Log.warn(err.message);
}
nextUplink();
}
);
@ -1214,7 +1217,7 @@ function FTNMessageScanTossModule() {
return false;
};
// ends an export block
this.exportingEnd = function() {
this.exportRunning = false;
@ -1263,14 +1266,15 @@ FTNMessageScanTossModule.prototype.startup = function(cb) {
'Export schedule loaded'
);
if(exportSchedule.sched && this.exportingStart()) {
if(exportSchedule.sched) {
this.exportTimer = later.setInterval( () => {
Log.info( { module : exports.moduleInfo.name }, 'Performing scheduled message scan/export...');
this.performExport( () => {
this.exportingEnd();
});
if(this.exportingStart()) {
Log.info( { module : exports.moduleInfo.name }, 'Performing scheduled message scan/export...');
this.performExport( () => {
this.exportingEnd();
});
}
}, exportSchedule.sched);
}