diff options
| author | RanXom <saiyedshizain@gmail.com> | 2026-07-14 10:57:01 +0530 |
|---|---|---|
| committer | RanXom <saiyedshizain@gmail.com> | 2026-07-14 10:57:01 +0530 |
| commit | ad97c2f3222dcdb8c124747feb4564ca9069fa1e (patch) | |
| tree | 7bbd6fb8551456529a0ca28121821c3f5fa431e5 /internal/service/photo.go | |
| parent | 826434a8597122847f643abe835d5c6e5dd74c4c (diff) | |
| download | galleryd-ad97c2f3222dcdb8c124747feb4564ca9069fa1e.tar.xz galleryd-ad97c2f3222dcdb8c124747feb4564ca9069fa1e.zip | |
refactor(service): synchronize gallery access
Diffstat (limited to 'internal/service/photo.go')
| -rw-r--r-- | internal/service/photo.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/service/photo.go b/internal/service/photo.go index 018ba6b..7242d8e 100644 --- a/internal/service/photo.go +++ b/internal/service/photo.go @@ -14,6 +14,9 @@ func (s *galleryService) Photo( ctx context.Context, id string, ) (gallery.Photo, error) { + s.mu.RLock() + defer s.mu.RUnlock() + select { case <-ctx.Done(): return gallery.Photo{}, ctx.Err() |