interface Job

A recurring task, exported by its module for main.ts to start.

Properties

name: string

Names it in the log, as [digest].

everyMs: number

How long from one run's start to the next.

optional
firstAfterMs: number

How long after the start the first run waits, everyMs by default.

Methods

run(): void | Promise<void>

Logs what it did itself, if anything; its errors are logged here.

Usage

import { type Job } from "api/lib/scheduler.ts";