diff options
author | 2022-09-19 13:59:11 +0200 | |
---|---|---|
committer | 2022-09-19 12:59:11 +0100 | |
commit | de26924a4a47fa6b48971cf51f51a5b732745e59 (patch) | |
tree | ac667f5a5089bbe832bba78fb0cf019075863d4c /internal/media/processingmedia.go | |
parent | [bugfix] Server and closer bugfixes (#839) (diff) | |
download | gotosocial-de26924a4a47fa6b48971cf51f51a5b732745e59.tar.xz |
don't error out if storage key already exists (#840)
Diffstat (limited to 'internal/media/processingmedia.go')
-rw-r--r-- | internal/media/processingmedia.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/media/processingmedia.go b/internal/media/processingmedia.go index 3f3a68f3f..e537c8301 100644 --- a/internal/media/processingmedia.go +++ b/internal/media/processingmedia.go @@ -162,7 +162,7 @@ func (p *ProcessingMedia) loadThumb(ctx context.Context) error { // put the thumbnail in storage log.Tracef("loadThumb: storing new thumbnail %s", p.attachment.URL) - if err := p.storage.Put(ctx, p.attachment.Thumbnail.Path, thumb.small); err != nil { + if err := p.storage.Put(ctx, p.attachment.Thumbnail.Path, thumb.small); err != nil && err != storage.ErrAlreadyExists { p.err = fmt.Errorf("loadThumb: error storing thumbnail: %s", err) atomic.StoreInt32(&p.thumbState, int32(errored)) return p.err @@ -341,7 +341,7 @@ func (p *ProcessingMedia) store(ctx context.Context) error { p.attachment.File.FileSize = fileSize // store this for now -- other processes can pull it out of storage as they please - if err := p.storage.PutStream(ctx, p.attachment.File.Path, clean); err != nil { + if err := p.storage.PutStream(ctx, p.attachment.File.Path, clean); err != nil && err != storage.ErrAlreadyExists { return fmt.Errorf("store: error storing stream: %s", err) } |