From ec4f8870d3c8a2d802715c98d95364b787e04958 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Thu, 23 Nov 2023 12:39:50 -0500 Subject: [PATCH] fix: fetches nssf uri even if already cached (#138) --- consumer/sm_context.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/consumer/sm_context.go b/consumer/sm_context.go index 33dc70e9..f9db21c4 100644 --- a/consumer/sm_context.go +++ b/consumer/sm_context.go @@ -92,16 +92,14 @@ func SelectSmf( nsiInformation := ue.GetNsiInformationFromSnssai(anType, snssai) if nsiInformation == nil { - if ue.NssfUri == "" { - // TODO: Set a timeout of NSSF Selection or will starvation here - for { - if err := SearchNssfNSSelectionInstance(ue, nrfUri, models.NfType_NSSF, - models.NfType_AMF, nil); err != nil { - ue.GmmLog.Errorf("AMF can not select an NSSF Instance by NRF[Error: %+v]", err) - time.Sleep(2 * time.Second) - } else { - break - } + // TODO: Set a timeout of NSSF Selection or will starvation here + for { + if err := SearchNssfNSSelectionInstance(ue, nrfUri, models.NfType_NSSF, + models.NfType_AMF, nil); err != nil { + ue.GmmLog.Errorf("AMF can not select an NSSF Instance by NRF[Error: %+v]", err) + time.Sleep(2 * time.Second) + } else { + break } }