method IScheduler.every
IScheduler.every<T = unknown>(
name: string,
intervalMs: number,
handler: SchedulerJobHandler<T>,
options?: ScheduleOptions<T>
): Promise<void>

Schedule a recurring job that fires every intervalMs milliseconds.

Type Parameters

T = unknown

Parameters

name: string

Unique job name

intervalMs: number

Interval in milliseconds

Callback to invoke on each fire

optional
options: ScheduleOptions<T>

Optional payload and retry config

Return Type

Promise<void>

Throws

Error

If a job with name is already scheduled

Usage

import { type IScheduler } from "common/src/index.ts";