aboutsummaryrefslogtreecommitdiff
path: root/internal/service/photo.go
diff options
context:
space:
mode:
authorSaiyed Shizain <saiyedshizain@gmail.com>2026-07-17 11:10:53 +0530
committerGitHub <noreply@github.com>2026-07-17 11:10:53 +0530
commit6afb80ab754da137939dd523ee419818026f9fb5 (patch)
treef9f94ec69ac87abe8060cefca8708572bc13bdd6 /internal/service/photo.go
parentbcfb199ac8e5399e1a92cfbbc28af3674f80959d (diff)
parent5ae787be3d1d9de3355f8b5662fea857204e693c (diff)
downloadgalleryd-6afb80ab754da137939dd523ee419818026f9fb5.tar.xz
galleryd-6afb80ab754da137939dd523ee419818026f9fb5.zip
Merge pull request #11 from RanXom/feat/live-gallery
Feat/live-gallery: live gallery with automatic filesystem reloads
Diffstat (limited to 'internal/service/photo.go')
-rw-r--r--internal/service/photo.go3
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()