braid-http 1.0.6 → 1.0.7
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/braid-http-client.js +3 -2
- package/package.json +1 -1
package/braid-http-client.js
CHANGED
|
@@ -283,9 +283,10 @@ async function braid_fetch (url, params = {}) {
|
|
|
283
283
|
let timeout = null
|
|
284
284
|
on_heartbeat = () => {
|
|
285
285
|
clearTimeout(timeout)
|
|
286
|
+
let wait_seconds = 1.2 * heartbeats + 3
|
|
286
287
|
timeout = setTimeout(() => {
|
|
287
|
-
on_error(new Error(`heartbeat not seen in ${
|
|
288
|
-
},
|
|
288
|
+
on_error(new Error(`heartbeat not seen in ${wait_seconds.toFixed(2)}s`))
|
|
289
|
+
}, wait_seconds * 1000)
|
|
289
290
|
}
|
|
290
291
|
on_heartbeat()
|
|
291
292
|
}
|