refactor: extract stat() out of cleanOldFailedPDF417Scans()
This commit is contained in:
parent
63f51f4f3e
commit
393e149b91
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue