How to use the @ionic/utils-process.sleep function in @ionic/utils-process

To help you get started, we’ve selected a few @ionic/utils-process examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionic-team / ionic-cli / packages / ionic / src / commands / package / build.ts View on Github external
async tailBuildLog(appflowId: string, buildId: number, token: string): Promise {
    let build;
    let start = 0;
    const ws = this.env.log.createWriteStream(LOGGER_LEVELS.INFO, false);

    let isCreatedMessage = false;
    while (!(build && (build.state === 'success' || build.state === 'failed'))) {
      await sleep(5000);
      build = await this.getPackageBuild(appflowId, buildId, token);
      if (build && build.state === 'created' && !isCreatedMessage) {
        ws.write(chalk.yellow('Concurrency limit reached: build will start as soon as other builds finish.'));
        isCreatedMessage = true;
      }
      const trace = build.job.trace;
      if (trace.length > start) {
        ws.write(trace.substring(start));
        start = trace.length;
      }
    }
    ws.end();

    return build;
  }
github ionic-team / ionic-cli / packages / ionic / src / commands / deploy / build.ts View on Github external
async tailBuildLog(appflowId: string, buildId: number, token: string): Promise {
    let build;
    let start = 0;
    const ws = this.env.log.createWriteStream(LOGGER_LEVELS.INFO, false);

    let isCreatedMessage = false;
    while (!(build && (build.state === 'success' || build.state === 'failed'))) {
      await sleep(5000);
      build = await this.getDeployBuild(appflowId, buildId, token);
      if (build && build.state === 'created' && !isCreatedMessage) {
        ws.write(chalk.yellow('Concurrency limit reached: build will start as soon as other builds finish.'));
        isCreatedMessage = true;
      }
      const trace = build.job.trace;
      if (trace.length > start) {
        ws.write(trace.substring(start));
        start = trace.length;
      }
    }
    ws.end();

    return build;
  }

@ionic/utils-process

Process utils for NodeJS

MIT
Latest version published 1 year ago

Package Health Score

68 / 100
Full package analysis

Similar packages