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 Sep 27, 2024
1 parent 338250a commit b93246a
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 b93246a

Please sign in to comment.