From 221ec08bc8dc4a9054e499821bcf9da37076c4a7 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 10 Mar 2017 21:13:30 -0700 Subject: [PATCH] * Don't archive non-good non-pkt files (e.g. TICs that are *not* rejected) * asyncSeries() for TIC import (SQLite transaction) --- core/scanner_tossers/ftn_bso.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index adf266f5..c7466037 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -1041,10 +1041,14 @@ function FTNMessageScanTossModule() { } archivePath = paths.join(self.moduleConfig.paths.retain, `good-pkt-${ts}--${fn}`); - } else { + } else if('good' !== status) { archivePath = paths.join(self.moduleConfig.paths.reject, `${status}-${type}--${ts}-${fn}`); + } else { + return cb(null); // don't archive non-good/pkt files } + Log.debug( { origPath : origPath, archivePath : archivePath, type : type, status : status }, 'Archiving import file'); + fse.copy(origPath, archivePath, err => { if(err) { Log.warn( { error : err.message, origPath : origPath, archivePath : archivePath, type : type, status : status }, 'Failed to archive packet file'); @@ -1528,7 +1532,7 @@ FTNMessageScanTossModule.prototype.processTicFilesInDirectory = function(importD }); }, function process(ticFilesInfo, callback) { - async.each(ticFilesInfo, (ticFileInfo, nextTicInfo) => { + async.eachSeries(ticFilesInfo, (ticFileInfo, nextTicInfo) => { self.processSingleTicFile(ticFileInfo, err => { if(err) { // archive rejected TIC stuff (.TIC + attach)