bump versions

This commit is contained in:
Jon Staab
2024-10-10 14:38:12 -07:00
parent b5809b6f72
commit edaf47ea35
5 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/net",
"version": "0.0.25",
"version": "0.0.26",
"author": "hodlbod",
"license": "MIT",
"description": "Utilities for connecting with nostr relays.",
+7 -3
View File
@@ -96,7 +96,7 @@ export class Connection extends Emitter {
this.emit('receive', this, message)
}
ensureConnected = async ({shouldReconnect = true}) => {
ensureConnected = async ({shouldReconnect = true} = {}) => {
const isUnhealthy = this.socket.isClosing() || this.socket.isClosed()
const noRecentFault = this.meta.lastFault < Date.now() - 60_000
@@ -107,10 +107,14 @@ export class Connection extends Emitter {
if (this.socket.isNew()) {
await this.socket.connect()
}
while (this.socket.isConnecting()) {
await sleep(100)
}
}
ensureAuth = async ({timeout = 3000}) => {
await this.ensureConnected({shouldReconnect: true})
ensureAuth = async ({timeout = 3000} = {}) => {
await this.ensureConnected()
if (this.meta.authStatus === AuthStatus.Pending) {
await Promise.race([