Skip to content

Conversation

@TapuCosmo
Copy link
Contributor

@TapuCosmo TapuCosmo commented Aug 23, 2025

Description

This makes the external library watcher wait for files in watched directories to finish being written before queuing jobs for each file.

This configures chokidar with awaitWriteFinish to wait for watched files to remain stable in size for 5 seconds before emitting its events. (https://github.com/paulmillr/chokidar?tab=readme-ov-file#performance)

This should fix issues with jobs prematurely running when there are slow writes to external libraries (e.g. when the external library is written to using Samba) and failing.

Fixes #17100

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/)

This makes the external library watcher wait for files in watched directories to finish being written before queuing jobs for each file.
Copy link
Collaborator

@etnoy etnoy left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. This looks like a good change for me.

@alextran1502 alextran1502 merged commit 1af10de into immich-app:main Aug 25, 2025
55 of 56 checks passed
ollioddi pushed a commit to ollioddi/immich that referenced this pull request Aug 27, 2025
immich-app#21180)

This makes the external library watcher wait for files in watched directories to finish being written before queuing jobs for each file.
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.

New photos fail to generate thumbnails from external library

4 participants