Interface MinimalJob<DataType, ReturnType, NameType>

MinimalJob

interface MinimalJob<DataType, ReturnType, NameType> {
    attemptsMade: number;
    data: DataType;
    delay: number;
    failedReason: string;
    finishedOn?: number;
    id?: string;
    name: NameType;
    opts: JobsOptions;
    parent?: ParentKeys;
    parentKey?: string;
    processedOn?: number;
    progress: number | object;
    repeatJobKey?: string;
    returnvalue: ReturnType;
    stacktrace: string[];
    timestamp: number;
    get prefix(): string;
    get queueName(): string;
    get queueQualifiedName(): string;
    asJSON(): JobJson;
    asJSONSandbox(): JobJsonSandbox;
    log(logRow): Promise<number>;
    update(data): Promise<void>;
    updateProgress(progress): Promise<void>;
}

Type Parameters

  • DataType = any
  • ReturnType = any
  • NameType extends string = string

Implemented by

Properties

attemptsMade: number

Number of attempts after the job has failed.

Default Value

0

data: DataType

The payload for this job.

delay: number

An amount of milliseconds to wait until this job can be processed.

Default Value

0

failedReason: string

Reason for failing.

finishedOn?: number

Timestamp for when the job finished (completed or failed).

id?: string
name: NameType

The name of the Job

The options object for this job.

parent?: ParentKeys

Object that contains parentId (id) and parent queueKey.

parentKey?: string

Fully qualified key (including the queue prefix) pointing to the parent of this job.

processedOn?: number

Timestamp for when the job was processed.

progress: number | object

The progress a job has performed so far.

Default Value

0

repeatJobKey?: string

Base repeat job key.

returnvalue: ReturnType

The value returned by the processor when processing this job.

Default Value

null

stacktrace: string[]

Stacktrace for the error (for failed jobs).

Default Value

null

timestamp: number

Timestamp when the job was created (unless overridden with job options).

Accessors

Methods

  • Logs one row of log data.

    Parameters

    • logRow: string

      string with log data to be logged.

    Returns Promise<number>

  • Updates a job's data

    Parameters

    • data: DataType

      the data that will replace the current jobs data.

    Returns Promise<void>

  • Updates a job's progress

    Parameters

    • progress: number | object

      number or object to be saved as progress.

    Returns Promise<void>

Generated using TypeDoc