Skip to content

Commit

Permalink
chore: await for sequential operations
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Oct 2, 2024
1 parent f88969d commit 1f14fc9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/sdk/src/protocols/base_protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ export class BaseProtocolSDK implements IBaseProtocolSDK {
return undefined;
}

await Promise.all([
this.peerManager.removePeer(peerToDisconnect),
this.peerManager.addPeer(newPeer[0])
]);
await this.peerManager.removePeer(peerToDisconnect);
await this.peerManager.addPeer(newPeer[0]);

this.log.debug(`Successfully renewed peer. New peer: ${newPeer[0].id}`);

Expand Down

0 comments on commit 1f14fc9

Please sign in to comment.