Commit 92b7f443 authored by Sonja Happ's avatar Sonja Happ
Browse files

AMQP: Do not run update for successfully deleted component

parent 67fc6e94
Pipeline #422074 passed with stages
in 41 minutes and 5 seconds
......@@ -25,6 +25,7 @@ import (
"encoding/json"
"fmt"
"log"
"strings"
"time"
"github.com/gin-gonic/gin"
......@@ -336,7 +337,14 @@ func (s *InfrastructureComponent) updateExternalIC(payload ICUpdate, body []byte
if err != nil {
// if component could not be deleted there are still configurations using it in the DB
// continue with the update to save the new state of the component and get back to the deletion later
log.Println(err)
if strings.Contains(err.Error(), "postponed") {
log.Println(err) // print log message
} else {
return err // return upon DB error
}
} else {
// if delete was successful, return here and do not run the update
return nil
}
}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment