mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 10:32:14 +00:00
fix: unref nat manager retries (#877)
The retry operation in the NAT Manager can prevent node from shutting down, so unref the retries so they don't keep adding work to the event loop.
This commit is contained in:
parent
a64c02838c
commit
ce2a624a09
@ -138,9 +138,9 @@ class NatManager {
|
||||
|
||||
this._client = {
|
||||
// these are all network operations so add a retry
|
||||
map: (...args) => retry(() => map(...args), { onFailedAttempt: log.error }),
|
||||
destroy: (...args) => retry(() => destroy(...args), { onFailedAttempt: log.error }),
|
||||
externalIp: (...args) => retry(() => externalIp(...args), { onFailedAttempt: log.error })
|
||||
map: (...args) => retry(() => map(...args), { onFailedAttempt: log.error, unref: true }),
|
||||
destroy: (...args) => retry(() => destroy(...args), { onFailedAttempt: log.error, unref: true }),
|
||||
externalIp: (...args) => retry(() => externalIp(...args), { onFailedAttempt: log.error, unref: true })
|
||||
}
|
||||
|
||||
return this._client
|
||||
|
Loading…
x
Reference in New Issue
Block a user