Back to Encore

encore.dev/cron

docs/ts/runtime/cron.mdx

1.57.51.1 KB
Original Source

Classes

<!-- symbol-start: CronJob -->

CronJob <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/cron/mod.ts#L5" />

Constructors

Constructor <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/cron/mod.ts#L8" />

new CronJob(name, cfg): CronJob

Parameters
name

string

cfg

CronJobConfig

Returns

CronJob

Properties

cfg

readonly cfg: CronJobConfig

name

readonly name: string

<!-- symbol-end -->

Type Aliases

<!-- symbol-start: CronJobConfig -->

CronJobConfig <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/cron/mod.ts#L14" />

ts
type CronJobConfig = {
  endpoint: () => Promise<unknown>;
  title?: string;
} & 
  | {
  every: DurationString;
}
  | {
  schedule: string;
};

Type Declaration

endpoint

endpoint: () => Promise<unknown>

Returns

Promise<unknown>

title?

optional title?: string

<!-- symbol-end -->