diff --git a/lib/plugins.js b/lib/plugins.js index 3bdf0181..fb6e561d 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -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) { diff --git a/lib/poller.js b/lib/poller.js index e657bb1e..fefb8d16 100644 --- a/lib/poller.js +++ b/lib/poller.js @@ -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))