From ad97c2f3222dcdb8c124747feb4564ca9069fa1e Mon Sep 17 00:00:00 2001 From: RanXom Date: Tue, 14 Jul 2026 10:57:01 +0530 Subject: refactor(service): synchronize gallery access --- internal/service/gallery_service.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/service/gallery_service.go') diff --git a/internal/service/gallery_service.go b/internal/service/gallery_service.go index e500bec..23a8e85 100644 --- a/internal/service/gallery_service.go +++ b/internal/service/gallery_service.go @@ -9,6 +9,9 @@ import ( // Gallery scans the configured roots and builds the gallery. func (s *galleryService) Gallery(ctx context.Context) ([]gallery.Photo, error) { + s.mu.RLock() + defer s.mu.RUnlock() + select { case <-ctx.Done(): return nil, ctx.Err() -- cgit v1.2.3