Skip to content

Commit

Permalink
fix Minio concurrency issues for PutObject
Browse files Browse the repository at this point in the history
  • Loading branch information
mstgnz committed Dec 17, 2023
1 parent 0b3e29b commit 9649b7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion minio/minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// set content type
s.mu.Lock()
s.cfg.PutObjectOptions.ContentType = http.DetectContentType(val)
s.mu.Unlock()

// put object
_, err := s.minio.PutObject(s.ctx, s.cfg.Bucket, key, file, file.Size(), s.cfg.PutObjectOptions)
s.mu.Unlock()

return err
}
Expand Down

0 comments on commit 9649b7a

Please sign in to comment.