Added eoseSubTimeout to pool's SubscriptionOptions (#284)

* added timeout sub option

* made eoseSubTimeout optional
This commit is contained in:
Egge 2023-09-01 12:50:12 +02:00 committed by GitHub
parent 85035d61f2
commit e9eac28bab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -82,7 +82,7 @@ export class SimplePool {
let eoseTimeout = setTimeout(() => {
eoseSent = true
for (let cb of eoseListeners.values()) cb()
}, this.eoseSubTimeout)
}, opts?.eoseSubTimeout || this.eoseSubTimeout)
relays
.filter((r, i, a) => a.indexOf(r) === i)

View File

@ -46,6 +46,7 @@ export type SubscriptionOptions = {
verb?: 'REQ' | 'COUNT'
skipVerification?: boolean
alreadyHaveEvent?: null | ((id: string, relay: string) => boolean)
eoseSubTimeout?: number
}
const newListeners = (): { [TK in keyof RelayEvent]: RelayEvent[TK][] } => ({