async processIssues()

in functions/src/cron.ts [42:68]


  async processIssues(
    org: string,
    name: string,
    issueConfig: types.IssueCleanupConfig
  ): Promise<types.Action[]> {
    log.debug(`processIssues(${org}/${name})`);

    const actions: types.Action[] = [];

    const lockActions = await this.handleClosedIssues(org, name, issueConfig);
    actions.push(...lockActions);

    const now = new Date();
    if (!util.isWorkday(now)) {
      console.log(
        `Not processing stale issues on a weekend: ${now.toDateString()} @ ${now.toLocaleTimeString()} (${
          Intl.DateTimeFormat().resolvedOptions().timeZone
        })`
      );
      return actions;
    }

    const staleActions = await this.handleStaleIssues(org, name, issueConfig);
    actions.push(...staleActions);

    return actions;
  }