feat: limit image request
/ publish (push) Successful in 3m9s

This commit is contained in:
2026-03-07 20:26:53 +01:00
parent 2f7ff28c9a
commit fca1030e1a
3 changed files with 12 additions and 2 deletions
+7
View File
@@ -60,6 +60,13 @@ func (s *Service) getImage(uid string) (file []byte, mimeType string, err error)
}
func (s *Service) GetImage(ctx context.Context, uid string, options Options) (img io.Reader, mimeType string, err error) {
if err = s.seph.Acquire(ctx, 1); err != nil {
err = fmt.Errorf("could not Acquire semaphore: %w", err)
return
}
defer s.seph.Release(1)
rawImage, mimeType, err := s.getImage(uid)
if err != nil {
return