fix(scanner): increase watcher channel buffers to prevent dropped filesystem events

When files were moved between libraries, the small channel buffers (size 1)
throughout the watcher pipeline caused backpressure that led to dropped
filesystem events. This meant only some of the affected folders were scanned,
preventing cross-library move detection from working correctly.

Increase all watcher channel buffers to 500 and switch to blocking sends
to ensure no filesystem events are silently dropped.
This commit is contained in:
Deluan
2026-03-12 17:07:34 -04:00
parent d0fbba14ff
commit 0790f66627
3 changed files with 6 additions and 10 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ func (s *localStorage) Start(ctx context.Context) (<-chan string, error) {
if !s.watching.CompareAndSwap(false, true) {
return nil, errors.New("watcher already started")
}
input := make(chan notify.EventInfo, 1)
output := make(chan string, 1)
input := make(chan notify.EventInfo, 500)
output := make(chan string, 500)
started := make(chan struct{})
go func() {