mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(server): Enqueue jobs in bulk (#5974)
* feat(server): Enqueue jobs in bulk The Job Repository now has a `queueAll` method, that enqueues messages in bulk (using BullMQ's [`addBulk`](https://docs.bullmq.io/guide/queues/adding-bulks)), improving performance when many jobs must be enqueued within the same operation. Primary change is in `src/domain/job/job.service.ts`, and other services have been refactored to use `queueAll` when useful. As a simple local benchmark, triggering a full thumbnail generation process over a library of ~1,200 assets and ~350 faces went from **~600ms** to **~250ms**. * fix: Review feedback
This commit is contained in:
parent
7dd88c4114
commit
4a5b8c3770
20 changed files with 323 additions and 227 deletions
|
|
@ -77,6 +77,7 @@ export const testApp = {
|
|||
deleteCronJob: jest.fn(),
|
||||
validateCronExpression: jest.fn(),
|
||||
queue: (item: JobItem) => jobs && _handler(item),
|
||||
queueAll: (items: JobItem[]) => jobs && Promise.all(items.map(_handler)).then(() => Promise.resolve()),
|
||||
resume: jest.fn(),
|
||||
empty: jest.fn(),
|
||||
setConcurrency: jest.fn(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue