Skip to content

Commit

Permalink
Fix semaphore
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaStebaev committed Sep 10, 2024
1 parent 5550b1c commit 2f55c36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/upgrader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ export abstract class Upgrader {
}

private async protectedDeployNewImplementation (contract: string) {
await this.deploySemaphore.acquire();
// Iterations have to be sequential
// eslint-disable-next-line no-await-in-loop
while(!await this.deploySemaphore.acquire()) {
console.log(`Deployment of the ${contract} implementation is waiting`);
}
let result: ContractToUpgrade | null = null;
try {
result = await this.deployNewImplementation(contract);
Expand Down

0 comments on commit 2f55c36

Please sign in to comment.