mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
do not remove file data from s3 storage if DELETE is executed for file
This commit is contained in:
parent
2932d89147
commit
b3404608d1
1 changed files with 9 additions and 5 deletions
|
@ -227,11 +227,15 @@ func (f *File) Delete() error {
|
||||||
|
|
||||||
// delete file from s3 bucket
|
// delete file from s3 bucket
|
||||||
if f.Key != "" {
|
if f.Key != "" {
|
||||||
err = f.deleteS3()
|
// TODO we do not delete the file from s3 object storage
|
||||||
if err != nil {
|
// to ensure that no data is lost if multiple File objects reference the same S3 data object
|
||||||
return err
|
// This behavior should be replaced by a different file handling in the future
|
||||||
}
|
//err = f.deleteS3()
|
||||||
log.Println("Deleted file in S3 object storage")
|
//if err != nil {
|
||||||
|
// return err
|
||||||
|
//}
|
||||||
|
//log.Println("Deleted file in S3 object storage")
|
||||||
|
log.Println("Did NOT delete file in S3 object storage!")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = db.Model(&so).Association("Files").Delete(f).Error
|
err = db.Model(&so).Association("Files").Delete(f).Error
|
||||||
|
|
Loading…
Add table
Reference in a new issue