private async waitForSettlements()

in src/commands/repair-package-data.ts [119:128]


  private async waitForSettlements(promises: Map<string, Promise<any>>, lowWaterMark: number) {
    console.error(`At ${promises.size} executions... waiting until there are less than ${lowWaterMark}...`);
    while (promises.size > lowWaterMark) {
      const { arn, status } = await Promise.race(promises.values());
      if (status !== 'SUCCEEDED') {
        console.error(`Execution ${arn} finished in ${status}`);
      }
      promises.delete(arn);
    }
  }