fix: add event listener on libp2p start for redundancy to ensure we max the events to read the peer count
This commit is contained in:
parent
2b04fecc7c
commit
f1b8a603df
|
@ -339,6 +339,8 @@ async function handleStatus(aq: ActiveQuery) {
|
|||
peersListener,
|
||||
);
|
||||
|
||||
ipfs.libp2p.addEventListener("start", peersListener);
|
||||
|
||||
aq.setReceiveUpdate?.(() => {
|
||||
peerEvents.forEach((ev) => {
|
||||
// @ts-ignore
|
||||
|
@ -347,6 +349,7 @@ async function handleStatus(aq: ActiveQuery) {
|
|||
peersListener,
|
||||
);
|
||||
});
|
||||
ipfs.libp2p.removeEventListener("start", peersListener);
|
||||
aq.respond();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue