update close() usage

Signed-off-by: BilligsterUser <billigsteruser@protonmail.com>
This commit is contained in:
BilligsterUser
2023-02-17 22:54:15 +01:00
committed by fiatjaf
parent 3d93ec8446
commit 7bfd23af3c
4 changed files with 8 additions and 10 deletions

View File

@@ -12,13 +12,11 @@ export class SimplePool {
this._conn = {}
}
async close(relays: string[]): Promise<void> {
await Promise.all(
relays.map(async url => {
close(relays: string[]): void {
relays.map(url => {
let relay = this._conn[normalizeURL(url)]
if (relay) await relay.close()
if (relay) relay.close()
})
)
}
async ensureRelay(url: string): Promise<Relay> {