Merge branch 'fix-scenario-duplication' of https://git.rwth-aachen.de/acs/public/villas/web-backend-go into fix-scenario-duplication

This commit is contained in:
irismarie 2021-10-15 13:04:03 +02:00
commit a78e70e78b
2 changed files with 11 additions and 5 deletions

View file

@ -270,8 +270,10 @@ func CheckConnection() error {
// WARNING: this only works with the kubernetes-simple manager of VILLAScontroller
func RequestICcreateAMQPsimpleManager(ic *database.InfrastructureComponent, managerUUID string, userName string) (string, error) {
newUUID := uuid.New().String()
log.Printf("New IC UUID: %s", newUUID)
var lastUpdate ICUpdateToCopy
log.Println(ic.StatusUpdateRaw.RawMessage)
err := json.Unmarshal(ic.StatusUpdateRaw.RawMessage, &lastUpdate)
if err != nil {
return newUUID, err

View file

@ -227,11 +227,15 @@ func (f *File) Delete() error {
// delete file from s3 bucket
if f.Key != "" {
err = f.deleteS3()
if err != nil {
return err
}
log.Println("Deleted file in S3 object storage")
// TODO we do not delete the file from s3 object storage
// to ensure that no data is lost if multiple File objects reference the same S3 data object
// This behavior should be replaced by a different file handling in the future
//err = f.deleteS3()
//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