Skip to content

Conversation

@uhthomas
Copy link
Collaborator

Description

Job workers are currently started on app init, which means they are started before the DB is initialised. This can be problematic if jobs which need to use the DB start running before it's ready. It also means that swapping out the queue implementation for something which uses the DB won't work.

Related to #17782

How Has This Been Tested?

  • Ran locally and started some jobs.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Copy link
Member

@zackpollard zackpollard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@uhthomas uhthomas force-pushed the fix-job-worker-init branch 2 times, most recently from 543d59e to 4a42fba Compare April 23, 2025 10:51
@jrasm91 jrasm91 force-pushed the fix-job-worker-init branch from 4a42fba to 6352eb6 Compare April 23, 2025 14:42
Job workers are currently started on app init, which means they are started
before the DB is initialised. This can be problematic if jobs which need to use
the DB start running before it's ready. It also means that swapping out the
queue implementation for something which uses the DB won't work.
@jrasm91 jrasm91 force-pushed the fix-job-worker-init branch from 6352eb6 to d6207fe Compare April 23, 2025 15:00
@jrasm91 jrasm91 enabled auto-merge (squash) April 23, 2025 15:01
@jrasm91 jrasm91 merged commit 987e5ab into main Apr 23, 2025
46 checks passed
@jrasm91 jrasm91 deleted the fix-job-worker-init branch April 23, 2025 15:07
shenlong-tanwen pushed a commit that referenced this pull request Jun 8, 2025
Job workers are currently started on app init, which means they are started
before the DB is initialised. This can be problematic if jobs which need to use
the DB start running before it's ready. It also means that swapping out the
queue implementation for something which uses the DB won't work.
savely-krasovsky pushed a commit to savely-krasovsky/immich that referenced this pull request Jun 8, 2025
Job workers are currently started on app init, which means they are started
before the DB is initialised. This can be problematic if jobs which need to use
the DB start running before it's ready. It also means that swapping out the
queue implementation for something which uses the DB won't work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants