Update runByID and Add queueAndRun Functions in PayloadCMS Queue System #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update runByID and Create queueAndRun Functions in PayloadCMS Queue System
This PR implements two changes to the queue system in the PayloadCMS codebase:
1. Updated the runByID Function
Modified the existing
runByID
function to optionally return the output of a task. Added a newreturnTaskOutput
parameter that, when set to true, will extract task outputs from job logs and return them along with the job status.2. Created a New queueAndRun Function
Added a new
queueAndRun
function that combines the functionality ofqueue
withrunById
, returning both the job and the result including any task output. This eliminates the need for separate steps to queue a job, run it, and then query it to get the output.Implementation Details
runByID
for better type safety of task outputsqueueAndRun
function with proper type definitionsLink to Devin run
https://app.devin.ai/sessions/2514ca4183d34fea95b8b043c4b72ccb
Requested by
Nathan Clevenger ([email protected])