Shorten reconnect timeout

This commit is contained in:
Jonathan Staab
2023-08-16 13:51:08 -07:00
parent a909ab6d28
commit 3b9b6f9dc0
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "paravel",
"version": "0.3.1",
"version": "0.3.2",
"description": "Yet another toolkit for nostr",
"repository": {
"type": "git",
+2 -2
View File
@@ -11,7 +11,7 @@ export class Pool extends EventEmitter {
has(url: string) {
return this.data.has(url)
}
get(url: string, {autoConnect = true} = {}) {
get(url: string, {autoConnect = true, reconnectAfter = 3000} = {}) {
let connection = this.data.get(url)
if (autoConnect) {
@@ -26,7 +26,7 @@ export class Pool extends EventEmitter {
}
connection.ensureConnected({
shouldReconnect: connection.meta.lastClose < Date.now() - 30_000,
shouldReconnect: connection.meta.lastClose < Date.now() - reconnectAfter,
})
}