fix: don't drop pings out of the table

This commit is contained in:
siiky 2025-06-16 17:35:49 +01:00
parent 8cf68e480a
commit 16761b0744

View file

@ -714,16 +714,9 @@ const enqueueRecordPing = ping => {
pendingRecordPings.set(ping.deviceId, ping)
}
// from @sindresorhus/is-empty-iterable
const isEmptyIterable = iter => {
for (const _ of iter) return false
return true
}
const batchRecordPendingPings = () => {
const pings = pendingRecordPings.values()
pendingRecordPings = new Map()
if (isEmptyIterable(pings)) return Promise.resolve()
return db.task(async t => {
for (const { deviceId, last_online, version, model } of pings) {