Skip to content

Commit

Permalink
feat: add waitUntil property to payload.jobs.queue (#9950)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioGr authored Dec 13, 2024
1 parent a582431 commit 0d07ce2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/payload/src/queues/localAPI.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RunningJobFromTask } from './config/types/workflowTypes.js'
import type { BaseJob, RunningJobFromTask } from './config/types/workflowTypes.js'

import {
createLocalReq,
Expand All @@ -23,6 +23,7 @@ export const getJobsLocalAPI = (payload: Payload) => ({
// TTaskOrWorkflowlug with keyof TypedJobs['workflows'] removed:
task: TTaskOrWorkflowSlug extends keyof TypedJobs['tasks'] ? TTaskOrWorkflowSlug : never
workflow?: never
waitUntil?: Date
}
| {
input: TypedJobs['workflows'][TTaskOrWorkflowSlug]['input']
Expand All @@ -32,6 +33,7 @@ export const getJobsLocalAPI = (payload: Payload) => ({
workflow: TTaskOrWorkflowSlug extends keyof TypedJobs['workflows']
? TTaskOrWorkflowSlug
: never
waitUntil?: Date
},
): Promise<
TTaskOrWorkflowSlug extends keyof TypedJobs['workflows']
Expand Down Expand Up @@ -59,7 +61,8 @@ export const getJobsLocalAPI = (payload: Payload) => ({
queue,
taskSlug: 'task' in args ? args.task : undefined,
workflowSlug: 'workflow' in args ? args.workflow : undefined,
},
waitUntil: args.waitUntil?.toISOString() ?? undefined,
} as BaseJob,
req: args.req,
})) as TTaskOrWorkflowSlug extends keyof TypedJobs['workflows']
? RunningJob<TTaskOrWorkflowSlug>
Expand Down

0 comments on commit 0d07ce2

Please sign in to comment.