Skip to content

Commit ab7afa7

Browse files
authored
fix: increase shutdown controller signal listeners (#62)
To prevent spurious warnings appearing in node.js, increase the max number of event listeners.
1 parent 5341fc1 commit ab7afa7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/client/src/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type ContentRouting, contentRouting } from '@libp2p/interface/content-routing'
22
import { CodeError } from '@libp2p/interface/errors'
3+
import { setMaxListeners } from '@libp2p/interface/events'
34
import { type PeerRouting, peerRouting } from '@libp2p/interface/peer-routing'
45
import { logger } from '@libp2p/logger'
56
import { peerIdFromString } from '@libp2p/peer-id'
@@ -39,6 +40,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
3940
constructor (url: string | URL, init: DelegatedRoutingV1HttpApiClientInit = {}) {
4041
this.started = false
4142
this.shutDownController = new AbortController()
43+
setMaxListeners(Infinity, this.shutDownController.signal)
4244
this.httpQueue = new PQueue({
4345
concurrency: init.concurrentRequests ?? defaultValues.concurrentRequests
4446
})

0 commit comments

Comments
 (0)