feat: add optional priority to upload metadata#3323
Open
tiborrr wants to merge 2 commits into
Open
Conversation
Allow API clients to set job processing priority (high/low) per upload via ItemUploadMeta, with endpoint-specific defaults and meta overriding source priority on open uploads. Co-authored-by: Cursor <cursoragent@cursor.com>
Expose high/low processing priority on the authenticated upload UI and include it in upload metadata, defaulting to high. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
priorityfield (high|low) to uploadmetaJSON (ItemUploadMeta)Motivation
I have to migrate a few thousand documents to Docspell, but do not want to clog the upload queue.
Upload priority was previously fixed by endpoint:
/api/v1/sec/upload/item)high/api/v1/open/upload/item/{sourceId})/api/v1/open/integration/item/{collective})There was no way to set priority per request. This adds per-upload control while keeping existing defaults when
priorityis omitted.Changes
Backend
OUpload.UploadMetawithpriority: Option[Priority]readMultipart: usemeta.prioritywhen set, otherwise endpoint defaultmeta.priorityoverrides source default when providedWebapp
priorityin upload metadataDocs / API
priorityonItemUploadMetaAPI example
Backward compatibility
Fully backward compatible. Omitted
prioritykeeps current behavior on all endpoints.Manual verification
Tested locally against
sbt reStart(H2, collectiveets, userets/admin) via/api/v1/sec/upload/item:meta.priority2026-04-15_AT2600707.pdf2026-04-15_AT2600723.pdf"low"2026-04-15_AT2600725.pdf"high"All three returned
{"success":true,"message":"Files submitted."}. Queue UI and joex logs matched expected priorities (process-item/Highvsprocess-item/Low). DB job records: priority10(high) for default and explicit high;0(low) for explicit low.Default secured upload without
prioritycorrectly uses high.