autobee-wakeup 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -66,16 +66,7 @@ module.exports = class AutobeeWakeup extends ReadyResource {
|
|
|
66
66
|
async flush() {
|
|
67
67
|
const hints = new Map(this._hints)
|
|
68
68
|
this._hints.clear()
|
|
69
|
-
|
|
70
|
-
for (const [hex, length] of hints) {
|
|
71
|
-
const key = b4a.from(hex, 'hex')
|
|
72
|
-
if (this._auto.writers.has(hex)) continue
|
|
73
|
-
if (length !== -1) {
|
|
74
|
-
const info = await this._auto.system.get(key)
|
|
75
|
-
if (info && length <= info.length) continue // stale hint
|
|
76
|
-
}
|
|
77
|
-
await this._auto.writers.wakeup(key, length === -1 ? 0 : length)
|
|
78
|
-
}
|
|
69
|
+
return hints
|
|
79
70
|
}
|
|
80
71
|
|
|
81
72
|
addStream(stream) {
|