X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fnbi%2Fhttprestful.go;h=794cee9d6cbc5724c43fa9b457c88eb92772a57f;hb=refs%2Fchanges%2F75%2F10075%2F1;hp=8222e72984da7d048617c5d9481362b3c312bc80;hpb=930db799fe886da7b2c80f89ed3f67c0433c4ed7;p=ric-plt%2Frtmgr.git diff --git a/pkg/nbi/httprestful.go b/pkg/nbi/httprestful.go index 8222e72..794cee9 100644 --- a/pkg/nbi/httprestful.go +++ b/pkg/nbi/httprestful.go @@ -49,6 +49,7 @@ import ( //"routing-manager/pkg/restapi/operations/handle" "routing-manager/pkg/rpe" "routing-manager/pkg/rtmgr" + "routing-manager/pkg/sbi" "routing-manager/pkg/sdl" "strconv" "strings" @@ -312,13 +313,18 @@ func CreateNewE2tHandleHandlerImpl(data *models.E2tData) error { m.Unlock() updateEp() //sendPartialRoutesToAll(nil, rtmgr.E2Type) + sbi.Conn.Lock() + rtmgr.RMRConnStatus[*data.E2TAddress] = false + sbi.Conn.Unlock() + sendRoutesToAll() time.Sleep(10 * time.Second) - for ep, value := range rtmgr.RMRConnStatus { - if ep == *data.E2TAddress && value == true { - rtmgr.RMRConnStatus[ep] = false //Reset to false incase of E2t restart scenario - return nil - } + if rtmgr.RMRConnStatus[*data.E2TAddress] == true { + sbi.Conn.Lock() + delete(rtmgr.RMRConnStatus, *data.E2TAddress) + sbi.Conn.Unlock() + xapp.Logger.Debug("RMRConnStatus Map after = %v", rtmgr.RMRConnStatus) + return nil } return errors.New("Error while adding new E2T " + *data.E2TAddress)