From 80a70e03d495d159fae4f8c9e5eda06d5a1b4ee9 Mon Sep 17 00:00:00 2001 From: javi11 Date: Mon, 25 May 2026 20:00:48 +0200 Subject: [PATCH] fix(config): unify library_sync_concurrency default to 5 Consolidate three divergent defaults (sample: 1, accessor: 5, inline: 10) by routing both call sites through GetLibrarySyncConcurrency() and updating the sample config comment to match the accessor's default of 5. Fixes #616 --- config.sample.yaml | 2 +- internal/health/library_sync.go | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/config.sample.yaml b/config.sample.yaml index 5919e1f4b..a2e7a2408 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -170,7 +170,7 @@ health: segment_sample_percentage: 5 # Percentage of segments to sample for health validation (1-100, default: 5) acceptable_missing_segments_percentage: 0 # Percentage of missing segments allowed before a file is marked as corrupted (0-100, default: 0) library_sync_interval_minutes: 360 # Library synchronization interval in minutes (default: 360 = 6 hours) - library_sync_concurrency: 1 # Number of concurrent library sync operations (default: 1) + library_sync_concurrency: 5 # Number of concurrent library sync operations (default: 5) resolve_repair_on_import: false # Automatically resolve pending repairs in the same directory when a new file is imported (default: false) # WebDAV mount path configuration diff --git a/internal/health/library_sync.go b/internal/health/library_sync.go index ff71f3589..3a7bd0eba 100644 --- a/internal/health/library_sync.go +++ b/internal/health/library_sync.go @@ -652,11 +652,7 @@ func (lsw *LibrarySyncWorker) SyncLibrary(ctx context.Context, dryRun bool) *Dry close(done) }() - // Get concurrency setting (default to 10 if not set) - concurrency := cfg.Health.LibrarySyncConcurrency - if concurrency <= 0 { - concurrency = 10 - } + concurrency := cfg.GetLibrarySyncConcurrency() // Create a worker pool for parallel metadata reading p := pool.New().WithMaxGoroutines(concurrency) @@ -1744,11 +1740,7 @@ func (lsw *LibrarySyncWorker) syncMetadataOnly(ctx context.Context, startTime ti var filesToAdd []database.AutomaticHealthCheckRecord var filesToAddMu sync.Mutex - // Get concurrency setting (default to 10 if not set) - concurrency := cfg.Health.LibrarySyncConcurrency - if concurrency <= 0 { - concurrency = 10 - } + concurrency := cfg.GetLibrarySyncConcurrency() // Create a worker pool for parallel metadata reading p := pool.New().WithMaxGoroutines(concurrency)