Page Contents

Home > @loopback/cron > cronJob

cronJob() function

@cronJob decorates a cron job provider class

Signature:

export declare function cronJob(...specs: BindingSpec[]): ClassDecorator;

Parameters

Parameter Type Description
specs BindingSpec[] Extra binding specs

Returns:

ClassDecorator

Example

@cronJob()
class CronJobProvider implements Provider<CronJob> {
  constructor(@config() private jobConfig: CronJobConfig = {}) {}
  value() {
    // ...
  }
}