Skip to content

Commit

Permalink
fix: increase shutdown controller signal listeners (#62)
Browse files Browse the repository at this point in the history
To prevent spurious warnings appearing in node.js, increase the max
number of event listeners.
  • Loading branch information
achingbrain authored Dec 5, 2023
1 parent 5341fc1 commit ab7afa7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/client/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type ContentRouting, contentRouting } from '@libp2p/interface/content-routing'
import { CodeError } from '@libp2p/interface/errors'
import { setMaxListeners } from '@libp2p/interface/events'
import { type PeerRouting, peerRouting } from '@libp2p/interface/peer-routing'
import { logger } from '@libp2p/logger'
import { peerIdFromString } from '@libp2p/peer-id'
Expand Down Expand Up @@ -39,6 +40,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
constructor (url: string | URL, init: DelegatedRoutingV1HttpApiClientInit = {}) {
this.started = false
this.shutDownController = new AbortController()
setMaxListeners(Infinity, this.shutDownController.signal)
this.httpQueue = new PQueue({
concurrency: init.concurrentRequests ?? defaultValues.concurrentRequests
})
Expand Down

0 comments on commit ab7afa7

Please sign in to comment.