function startDeleteOldBuildsCron(storageMethod, options) {
  if (options.storage.storageMethod !== 'sql' || !options.deleteOldBuildsCron) {
    return;
  }

  /** @type {(s: string) => void} */
  const log =
    options.logLevel === 'silent'
      ? () => {}
      : msg => process.stdout.write(`${new Date().toISOString()} - ${msg}\n`);

  /**
   *
   * @type {LHCI.ServerCommand.DeleteOldBuildsCron[]}
   */
  const cronConfig = Array.isArray(options.deleteOldBuildsCron)
    ? options.deleteOldBuildsCron
    : [options.deleteOldBuildsCron];

  cronConfig.forEach((config, index) => {
    if (!config.schedule || !config.maxAgeInDays) {
      throw new Error(
        `Can't configure schedule because you didn't specify 'schedule' field or 'maxAgeInDays' field in item with index: ${index}`
      );
    }

    runCronJob(storageMethod, log, config);
  });
}
@param {LHCI.ServerCommand.StorageMethod} storageMethod
@param {LHCI.ServerCommand.Options} options
@return {void}