awscloud: close the file after it's uploaded to S3
Oops, this was forgotten. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
70b6353918
commit
381bce9ac0
1 changed files with 7 additions and 0 deletions
|
|
@ -131,6 +131,13 @@ func (a *AWS) Upload(filename, bucket, key string) (*s3manager.UploadOutput, err
|
|||
return nil, err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
err := file.Close()
|
||||
if err != nil {
|
||||
logrus.Warnf("[AWS] ‼ Failed to close the file uploaded to S3️: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
logrus.Infof("[AWS] 🚀 Uploading image to S3: %s/%s", bucket, key)
|
||||
return a.uploader.Upload(
|
||||
&s3manager.UploadInput{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue