Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add waitUntil property to payload.jobs.queue #9950

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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