Skip to content

Feature/adjunct queue endpoint#1228

Draft
JackLewis-digirati wants to merge 5 commits into
developfrom
feature/adjunctQueueEndpoint
Draft

Feature/adjunct queue endpoint#1228
JackLewis-digirati wants to merge 5 commits into
developfrom
feature/adjunctQueueEndpoint

Conversation

@JackLewis-digirati

Copy link
Copy Markdown
Collaborator

What does this change?

Database Migration

Infrastructure Changes

Configuration Changes

@JackLewis-digirati

Copy link
Copy Markdown
Collaborator Author

What this implements

Closes #1157 and #1158.

#1157GET /customers/{customer}/adjunctQueue

New overview endpoint, equivalent to GET /customers/{customer}/queue:

  • size — total adjuncts in the queue across all batches, decreases as adjuncts are processed. Backed by a new Queues row with Name = "adjunct" (the table already supports arbitrary names; no schema change needed). This reuses the increment path that already existed in IngestNotificationSender.SendIngestAdjunctRequest.
  • batchesWaiting / adjunctsWaiting — batches/adjuncts that have been submitted but not yet started (Completed = 0 AND Errors = 0, batch not Finished). Deliberately excludes batches currently being worked on, which still count towards size.
  • batches / active / recent links, resolving to the endpoints below.

#1158 — bulk adjunct batch GET endpoints

  • GET /adjunctQueue/batches — all batches, most recently submitted first by default.
  • GET /adjunctQueue/active — batches with at least one adjunct still being worked on (Finished IS NULL).
  • GET /adjunctQueue/recent — completed batches, ordered by finished descending.
  • All three support page/pageSize (same config as the asset batch endpoints). /batches and /active support orderBy/orderByDescending, ordering by submission date (AdjunctBatch doesn't have a Created field, only Submitted — mirrors the existing convention for adjunct items where any unrecognised field name is ignored and the one supported field is used).

Bug fix along the way

Engine/Ingest/IngestHandler.cs was decrementing the wrong Queues row for every completed adjunct — it only distinguished "priority" vs "default" by SQS queue name, so adjunct completions fell through to "default" and silently corrupted the customer's image queue size while never decrementing "adjunct". Fixed to resolve the queue name from the ingest request type.

Also fixed DlcsDatabaseFixture.CleanUp(), which never cleared AdjunctBatches/AdjunctBatchAdjuncts between integration tests, causing state to leak across the suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant