Shorten reconnect timeout
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "paravel",
|
"name": "paravel",
|
||||||
"version": "0.3.1",
|
"version": "0.3.2",
|
||||||
"description": "Yet another toolkit for nostr",
|
"description": "Yet another toolkit for nostr",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ export class Pool extends EventEmitter {
|
|||||||
has(url: string) {
|
has(url: string) {
|
||||||
return this.data.has(url)
|
return this.data.has(url)
|
||||||
}
|
}
|
||||||
get(url: string, {autoConnect = true} = {}) {
|
get(url: string, {autoConnect = true, reconnectAfter = 3000} = {}) {
|
||||||
let connection = this.data.get(url)
|
let connection = this.data.get(url)
|
||||||
|
|
||||||
if (autoConnect) {
|
if (autoConnect) {
|
||||||
@@ -26,7 +26,7 @@ export class Pool extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
connection.ensureConnected({
|
connection.ensureConnected({
|
||||||
shouldReconnect: connection.meta.lastClose < Date.now() - 30_000,
|
shouldReconnect: connection.meta.lastClose < Date.now() - reconnectAfter,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user