diff --git a/lib/poller.js b/lib/poller.js index 02834902..b3bba26b 100644 --- a/lib/poller.js +++ b/lib/poller.js @@ -143,6 +143,8 @@ const readdirRec = rootPath => )) .then(_.flatten) +const stat = path => fs.stat(path).then(_.set('path', path)) + // @see lib/customers.js:updateIdCardData() const cleanOldFailedPDF417Scans = () => { let old = new Date() @@ -156,7 +158,7 @@ const cleanOldFailedPDF417Scans = () => { .then(entries => Promise.all( entries .filter(entry => entry.isFile()) - .map(entry => fs.stat(entry.path).then(_.set('path', entry.path))) + .map(entry => stat(entry.path)) )) .then(filestats => Promise.all( filestats