@@ -121,30 +121,12 @@ func (a *AttachmentStore) putMultiPipeline(ctx context.Context, r io.Reader, siz
121121 if previous != nil {
122122 a .log .Debug ("put multi, previous exists. Changing object key from %q to %q" , task .S3Params .ObjectKey , previous .ObjectKey )
123123 task .S3Params .ObjectKey = previous .ObjectKey
124+ }
124125
125- // for some unknown reason, this seems to be getting an access denied error sometimes.
126- var err error
127- multi , err = b .Multi (ctx , previous .ObjectKey , "application/octet-stream" , s3 .ACL (task .S3Params .Acl ))
128- if err != nil {
129- a .log .Debug ("putMultiPipeline b.Multi after using previous.ObjectKey error: %s" , err )
130- a .log .Debug ("putMultiPipeline trying b.Multi with new ObjectKey" )
131- multi , err = b .Multi (ctx , task .S3Params .ObjectKey , "application/octet-stream" , s3 .ACL (task .S3Params .Acl ))
132- if err != nil {
133- a .log .Debug ("putMultiPipeline b.Multi retry with new ObjectKey error: %s" , err )
134- return "" , NewErrorWrapper ("s3 Multi retry error" , err )
135- }
136- } else {
137- a .log .Debug ("putMultiPipeline b.Multi success using previous.ObjectKey" )
138- task .S3Params .ObjectKey = previous .ObjectKey
139- }
140- } else {
141- var err error
142- multi , err = b .Multi (ctx , task .S3Params .ObjectKey , "application/octet-stream" , s3 .ACL (task .S3Params .Acl ))
143- if err != nil {
144- a .log .Debug ("putMultiPipeline b.Multi error: %s" , err )
145- a .log .Debug ("putMultiPipeline object key: %q, acl: %+v" , task .S3Params .ObjectKey , task .S3Params .Acl )
146- return "" , NewErrorWrapper ("s3 Multi error" , err )
147- }
126+ multi , err := b .Multi (ctx , task .S3Params .ObjectKey , "application/octet-stream" , s3 .ACL (task .S3Params .Acl ))
127+ if err != nil {
128+ a .log .Debug ("putMultiPipeline b.Multi error: %s" , err )
129+ return "" , NewErrorWrapper ("s3 Multi error" , err )
148130 }
149131
150132 var previousParts map [int ]s3.Part
0 commit comments