fix: poller functions have to return promises
This commit is contained in:
parent
6f1b0c6e5f
commit
c53c479735
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
|
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
|
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`
|
WHERE d.device_id = h.device_id AND h.created < d.lastEntry`
|
||||||
db.none(sql)
|
return db.none(sql)
|
||||||
}
|
}
|
||||||
|
|
||||||
function isHd (tx) {
|
function isHd (tx) {
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ const cleanOldFailedPDF417Scans = () => {
|
||||||
/* NOTE: Small caveat to mtime: last time the file was written to. */
|
/* NOTE: Small caveat to mtime: last time the file was written to. */
|
||||||
const isOld = filestat => filestat.mtimeMs < old
|
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(
|
.then(entries => Promise.all(
|
||||||
entries
|
entries
|
||||||
.filter(entry => entry.isFile() && isPDF417Scan(entry))
|
.filter(entry => entry.isFile() && isPDF417Scan(entry))
|
||||||
|
|
@ -178,7 +178,7 @@ const cleanOldFailedQRScans = () => {
|
||||||
return then < old
|
return then < old
|
||||||
}
|
}
|
||||||
|
|
||||||
readdirRec(path.join(OPERATOR_DATA_DIR, 'failedQRScans'))
|
return readdirRec(path.join(OPERATOR_DATA_DIR, 'failedQRScans'))
|
||||||
.then(entries => Promise.all(
|
.then(entries => Promise.all(
|
||||||
entries
|
entries
|
||||||
.filter(entry => entry.isFile() && isOld(entry.path))
|
.filter(entry => entry.isFile() && isOld(entry.path))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue