Skip to main content

@nest-boot/schedule

Classes

ScheduleModule

Defined in: packages/schedule/src/schedule.module.ts:36

Extends

  • ConfigurableModuleClass

Indexable

[key: string]: any

Constructors

Constructor
new ScheduleModule(): ScheduleModule;

Defined in: node_modules/.pnpm/@nestjs+common@11.1.9/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.d.ts:12

Returns

ScheduleModule

Inherited from
ConfigurableModuleClass.constructor

Properties

forRoot()
static forRoot: (options) => DynamicModule;
Parameters
ParameterType
optionsScheduleModuleOptions & Partial<{ }>
Returns

DynamicModule

Inherited from
ConfigurableModuleClass.forRoot
forRootAsync()
static forRootAsync: (options) => DynamicModule;
Parameters
ParameterType
optionsConfigurableModuleAsyncOptions<ScheduleModuleOptions, "create"> & Partial<{ }>
Returns

DynamicModule

Inherited from
ConfigurableModuleClass.forRootAsync

ScheduleRegistry

Defined in: packages/schedule/src/schedule.registry.ts:12

Implements

  • OnApplicationBootstrap

Constructors

Constructor
new ScheduleRegistry(
queue,
reflector,
discoveryService,
metadataScanner): ScheduleRegistry;

Defined in: packages/schedule/src/schedule.registry.ts:23

Parameters
ParameterType
queueQueue
reflectorReflector
discoveryServiceDiscoveryService
metadataScannerMetadataScanner
Returns

ScheduleRegistry

Methods

get()
get(name): 
| {
handler: () => Promise<void>;
options: ScheduleOptions;
}
| undefined;

Defined in: packages/schedule/src/schedule.registry.ts:31

Parameters
ParameterType
namestring
Returns

| { handler: () => Promise<void>; options: ScheduleOptions; } | undefined

onApplicationBootstrap()
onApplicationBootstrap(): Promise<void>;

Defined in: packages/schedule/src/schedule.registry.ts:109

Returns

Promise<void>

Implementation of
OnApplicationBootstrap.onApplicationBootstrap

Interfaces

ScheduleModuleOptions

Defined in: packages/schedule/src/schedule-module-options.interface.ts:3

Public Api

Extends

Properties

autorun?
optional autorun: boolean;

Defined in: packages/schedule/src/schedule-module-options.interface.ts:4

blockingConnection?
optional blockingConnection: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:21

Denotes commands should retry indefinitely.

Deprecated

not in use anymore.

Inherited from

RegisterQueueOptions.blockingConnection

concurrency?
optional concurrency: number;

Defined in: packages/schedule/src/schedule-module-options.interface.ts:5

configKey?
optional configKey: string;

Defined in: node_modules/.pnpm/@nestjs+bullmq@11.0.4/node_modules/@nestjs/bullmq/dist/interfaces/register-queue-options.interface.d.ts:20

Shared configuration key

Default
default
Inherited from

RegisterQueueOptions.configKey

connection?
optional connection: ConnectionOptions;
Inherited from

ScheduleModuleOptions.connection

defaultJobOptions?
optional defaultJobOptions: DefaultJobOptions;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:49

Inherited from

RegisterQueueOptions.defaultJobOptions

forceDisconnectOnShutdown?
optional forceDisconnectOnShutdown: boolean;

Defined in: node_modules/.pnpm/@nestjs+bullmq@11.0.4/node_modules/@nestjs/bullmq/dist/interfaces/register-queue-options.interface.d.ts:35

When true, the queue will be force disconnected from Redis in the "onApplicationShutdown" lifecycle event. Otherwise, the queue will be gracefully disconnected.

Default
false
Inherited from

RegisterQueueOptions.forceDisconnectOnShutdown

name?
optional name: string;

Defined in: node_modules/.pnpm/@nestjs+bullmq@11.0.4/node_modules/@nestjs/bullmq/dist/interfaces/register-queue-options.interface.d.ts:14

Queue name

Default
default
Inherited from

RegisterQueueOptions.name

prefix?
optional prefix: string;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:25

Prefix for all queue keys.

Inherited from

RegisterQueueOptions.prefix

processors?
optional processors: BullQueueProcessor[];

Defined in: node_modules/.pnpm/@nestjs+bullmq@11.0.4/node_modules/@nestjs/bullmq/dist/interfaces/register-queue-options.interface.d.ts:24

Additional queue processors

Inherited from

RegisterQueueOptions.processors

settings?
optional settings: AdvancedRepeatOptions;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:76

Advanced options for the repeatable jobs.

Inherited from

RegisterQueueOptions.settings

sharedConnection?
optional sharedConnection: boolean;

Defined in: node_modules/.pnpm/@nestjs+bullmq@11.0.4/node_modules/@nestjs/bullmq/dist/interfaces/register-queue-options.interface.d.ts:29

Deprecated

This option is not supported in BullMQ 5 and considered a bad practice in prior versions.

Inherited from

RegisterQueueOptions.sharedConnection

skipMetasUpdate?
optional skipMetasUpdate: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:72

Skip Meta update.

If true, the queue will not update the metadata of the queue. Useful for read-only systems that do should not update the metadata.

Default Value
false
Inherited from

RegisterQueueOptions.skipMetasUpdate

skipVersionCheck?
optional skipVersionCheck: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:30

Avoid version validation to be greater or equal than v5.0.0.

Default Value
false
Inherited from

RegisterQueueOptions.skipVersionCheck

skipWaitingForReady?
optional skipWaitingForReady: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:43

Skip waiting for connection ready.

In some instances if you want the queue to fail fast if the connection is not ready you can set this to true. This could be useful for testing and when adding jobs via HTTP endpoints for example.

Inherited from

RegisterQueueOptions.skipWaitingForReady

streams?
optional streams: {
events: {
maxLen: number;
};
};

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:53

Options for the streams used internally in BullMQ.

events
events: {
maxLen: number;
};

Options for the events stream.

events.maxLen
maxLen: number;

Max approximated length for streams. Default is 10 000 events.

Inherited from

RegisterQueueOptions.streams

telemetry?
optional telemetry: Telemetry<any>;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:34

Telemetry client

Inherited from

RegisterQueueOptions.telemetry


ScheduleOptions

Defined in: packages/schedule/src/schedule-options.interface.ts:3

Extends

Properties

attempts?
optional attempts: number;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:29

The total number of attempts to try the job until it completes.

Default Value
1
Inherited from
JobSchedulerTemplateOptions.attempts
backoff?
optional backoff: number | BackoffOptions;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:33

Backoff setting for automatic retries if the job fails

Inherited from
JobSchedulerTemplateOptions.backoff
continueParentOnFailure?
optional continueParentOnFailure: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/types/job-options.d.ts:26

If true, starts processing parent job as soon as any of its children fail.

Inherited from
JobSchedulerTemplateOptions.continueParentOnFailure
failParentOnFailure?
optional failParentOnFailure: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/types/job-options.d.ts:20

If true, moves parent to failed if any of its children fail.

Inherited from
JobSchedulerTemplateOptions.failParentOnFailure
ignoreDependencyOnFailure?
optional ignoreDependencyOnFailure: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/types/job-options.d.ts:30

If true, moves the jobId from its parent dependencies to failed dependencies when it fails after all attempts.

Inherited from
JobSchedulerTemplateOptions.ignoreDependencyOnFailure
keepLogs?
optional keepLogs: number;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:59

Maximum amount of log entries that will be preserved

Inherited from
JobSchedulerTemplateOptions.keepLogs
lifo?
optional lifo: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:39

If true, adds the job to the right of the queue instead of the left (default false)

See

https://docs.bullmq.io/guide/jobs/lifo

Inherited from
JobSchedulerTemplateOptions.lifo
parent?
optional parent: ParentOptions;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:89

Parent options

Inherited from
JobSchedulerTemplateOptions.parent
prevMillis?
optional prevMillis: number;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:93

Internal property used by repeatable jobs.

Inherited from
JobSchedulerTemplateOptions.prevMillis
priority?
optional priority: number;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:17

Ranges from 0 (highest priority) to 2 097 152 (lowest priority). Note that using priorities has a slight impact on performance, so do not use it if not required.

Default Value
0
Inherited from
JobSchedulerTemplateOptions.priority
removeDependencyOnFailure?
optional removeDependencyOnFailure: boolean;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/types/job-options.d.ts:34

If true, removes the job from its parent dependencies when it fails after all attempts.

Inherited from
JobSchedulerTemplateOptions.removeDependencyOnFailure
removeOnComplete?
optional removeOnComplete: number | boolean | KeepJobs;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:47

If true, removes the job when it successfully completes When given a number, it specifies the maximum amount of jobs to keep, or you can provide an object specifying max age and/or count to keep. It overrides whatever setting is used in the worker. Default behavior is to keep the job in the completed set.

Inherited from
JobSchedulerTemplateOptions.removeOnComplete
removeOnFail?
optional removeOnFail: number | boolean | KeepJobs;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:55

If true, removes the job when it fails after all attempts. When given a number, it specifies the maximum amount of jobs to keep, or you can provide an object specifying max age and/or count to keep. It overrides whatever setting is used in the worker. Default behavior is to keep the job in the failed set.

Inherited from
JobSchedulerTemplateOptions.removeOnFail
repeatJobKey?
optional repeatJobKey: string;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:77

Internal property used by repeatable jobs to save base repeat job key.

Inherited from
JobSchedulerTemplateOptions.repeatJobKey
sizeLimit?
optional sizeLimit: number;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:67

Limits the size in bytes of the job's data payload (as a JSON serialized string).

Inherited from
JobSchedulerTemplateOptions.sizeLimit
stackTraceLimit?
optional stackTraceLimit: number;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:63

Limits the amount of stack trace lines that will be recorded in the stacktrace.

Inherited from
JobSchedulerTemplateOptions.stackTraceLimit
telemetry?
optional telemetry: {
metadata?: string;
omitContext?: boolean;
};

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/types/job-options.d.ts:38

Telemetry options

metadata?
optional metadata: string;

Metadata, used for context propagation.

omitContext?
optional omitContext: boolean;

If true telemetry will omit the context propagation

Default Value
false
Inherited from
JobSchedulerTemplateOptions.telemetry
timestamp?
optional timestamp: number;

Defined in: node_modules/.pnpm/bullmq@5.66.1/node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts:10

Timestamp when the job was created.

Default Value
Date.now()
Inherited from
JobSchedulerTemplateOptions.timestamp
timezone?
optional timezone: string;

Defined in: packages/schedule/src/schedule-options.interface.ts:6

type
type: "cron" | "interval";

Defined in: packages/schedule/src/schedule-options.interface.ts:4

value
value: string | number;

Defined in: packages/schedule/src/schedule-options.interface.ts:5

Functions

Cron()

function Cron(value, options?): <T>(target, propertyKey, descriptor) => void;

Defined in: packages/schedule/src/schedule.decorator.ts:20

Parameters

ParameterType
valuestring
options?Omit<ScheduleOptions, "type" | "value">

Returns

<T>(
target,
propertyKey,
descriptor): void;
Type Parameters
Type Parameter
T
Parameters
ParameterType
targetobject
propertyKeystring
descriptorTypedPropertyDescriptor<T>
Returns

void


Interval()

function Interval(value, options?): <T>(target, propertyKey, descriptor) => void;

Defined in: packages/schedule/src/schedule.decorator.ts:30

Parameters

ParameterType
valuestring | number
options?Omit<ScheduleOptions, "type" | "value">

Returns

<T>(
target,
propertyKey,
descriptor): void;
Type Parameters
Type Parameter
T
Parameters
ParameterType
targetobject
propertyKeystring
descriptorTypedPropertyDescriptor<T>
Returns

void


Schedule()

function Schedule(options): <T>(target, propertyKey, descriptor) => void;

Defined in: packages/schedule/src/schedule.decorator.ts:7

Parameters

ParameterType
optionsScheduleOptions

Returns

<T>(
target,
propertyKey,
descriptor): void;
Type Parameters
Type Parameter
T
Parameters
ParameterType
targetobject
propertyKeystring
descriptorTypedPropertyDescriptor<T>
Returns

void