Merge pull request #1822 from RafaelTaranto/fix/poller-functions-have-to-be-promises
LAM-1280 fix: poller functions have to return promises
This commit is contained in:
commit
3ccc202efa
2 changed files with 3 additions and 3 deletions
|
|
@ -370,7 +370,7 @@ function plugins (settings, deviceId) {
|
|||
const sql = `DELETE FROM machine_network_heartbeat h
|
||||
USING (SELECT device_id, max(created) as lastEntry FROM machine_network_heartbeat GROUP BY device_id) d
|
||||
WHERE d.device_id = h.device_id AND h.created < d.lastEntry`
|
||||
db.none(sql)
|
||||
return db.none(sql)
|
||||
}
|
||||
|
||||
function isHd (tx) {
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ const cleanOldFailedPDF417Scans = () => {
|
|||
/* NOTE: Small caveat to mtime: last time the file was written to. */
|
||||
const isOld = filestat => filestat.mtimeMs < old
|
||||
|
||||
readdirRec(path.join(OPERATOR_DATA_DIR, 'id-operator'))
|
||||
return readdirRec(path.join(OPERATOR_DATA_DIR, 'id-operator'))
|
||||
.then(entries => Promise.all(
|
||||
entries
|
||||
.filter(entry => entry.isFile() && isPDF417Scan(entry))
|
||||
|
|
@ -178,7 +178,7 @@ const cleanOldFailedQRScans = () => {
|
|||
return then < old
|
||||
}
|
||||
|
||||
readdirRec(path.join(OPERATOR_DATA_DIR, 'failedQRScans'))
|
||||
return readdirRec(path.join(OPERATOR_DATA_DIR, 'failedQRScans'))
|
||||
.then(entries => Promise.all(
|
||||
entries
|
||||
.filter(entry => entry.isFile() && isOld(entry.path))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue