Skip to content

Commit

Permalink
fix: catch errors when reconnecting old peers (#1352)
Browse files Browse the repository at this point in the history
Since we don't wait for successful reconnection to existing peers,
the peerstore can be closed while we're accessing it since we might
be shut down right after we've started up, e.g. during test runs so
just log any reconnect errors instead of throwing.
  • Loading branch information
achingbrain authored Aug 14, 2022
1 parent 2262f81 commit 886759b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/connection-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ export class DefaultConnectionManager extends EventEmitter<ConnectionManagerEven
})
)
})
.catch(err => {
log.error(err)
})
.finally(() => {
this.connectOnStartupController?.clear()
})
Expand Down

0 comments on commit 886759b

Please sign in to comment.