Function Cron

  • Creates a decorator @Cron("...") to create a cron task.

    Parameters

    • crontab: string

      The cron schedule in string format.

    Returns ((target, propertyKey) => void)

    • The decorator function.
      • (target, propertyKey): void
      • Parameters

        • target: any
        • propertyKey: string

        Returns void

    Example

    The following code creates a Cronjob that is executed every hour.

    @Cron("0 * * * *")
    async runTask() {
    // run scheduled tasks
    }

Generated using TypeDoc