public async function genRun()

in src/shipit/ShipItShellCommand.php [78:105]


  public async function genRun(): Awaitable<ShipItShellCommandResult> {
    $max_tries = $this->retries + 1;
    $tries_remaining = $max_tries;
    invariant(
      $tries_remaining >= 1,
      "Need positive number of tries, got %d",
      $tries_remaining,
    );

    while ($tries_remaining > 1) {
      try {
        // @lint-ignore AWAIT_IN_LOOP We need to do this serially
        $result = await $this->genRunOnce();
        // Handle case when $this->throwForNonZeroExit === false
        if ($result->getExitCode() !== 0) {
          throw new ShipItShellCommandException(
            $this->getCommandAsString(),
            $result,
          );
        }
        return $result;
      } catch (ShipItShellCommandException $_ex) {
        --$tries_remaining;
        continue;
      }
    }
    return await $this->genRunOnce();
  }