Μετάβαση στο περιεχόμενο

withJobContext

Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.

withJobContext<T>(data): WithJobContext<T>

Defined in: packages/pipeline-job-context/src/helpers/with-job-context.ts:26

Stamps the current execution context onto a job payload: the tenant and correlation id of the registered sources (a new one from the correlation source’s create() when none is active), and the principal the registered IJobPrincipal captures, reduced to its identity. The processor restores it with @InJobContext.

T extends Record<string, unknown>

T

The payload. Must be a plain object; a shallow copy is returned.

WithJobContext<T>

A copy of data with jobContext added.

When data is not a plain object.

Without a registerJobContext registration, a current tenant, or a current principal.

await queue.add('send', withJobContext({ userId, email }));