From ec1368b90059f7bcf4cc6b7481a42af0e53b650b Mon Sep 17 00:00:00 2001 From: Jack Ding <7378668+jzding@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:26:03 -0400 Subject: [PATCH] update sdk-go to add ResetFailCount to subscriberAPI (#79) Signed-off-by: Jack Ding --- go.mod | 2 +- go.sum | 4 ++-- .../redhat-cne/sdk-go/v1/subscriber/subscriber.go | 8 ++++++++ vendor/modules.txt | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 0a694ec..6ffbe02 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.0 github.com/prometheus/client_golang v1.14.0 - github.com/redhat-cne/sdk-go v1.0.1-0.20240816174822-51aca34ab94e + github.com/redhat-cne/sdk-go v1.0.1-0.20240826142227-273e2055e3b6 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.8.0 golang.org/x/net v0.7.0 diff --git a/go.sum b/go.sum index f919559..3b72862 100644 --- a/go.sum +++ b/go.sum @@ -53,8 +53,8 @@ github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/redhat-cne/sdk-go v1.0.1-0.20240816174822-51aca34ab94e h1:Viv1sLn0gru6kj98DwEoWtw3Kx/NF0LtmNCq0zR0VxU= -github.com/redhat-cne/sdk-go v1.0.1-0.20240816174822-51aca34ab94e/go.mod h1:q9LxxPbK1tGpDbQm/KIPujqdP0bK1hhuHrIXV3vuUrM= +github.com/redhat-cne/sdk-go v1.0.1-0.20240826142227-273e2055e3b6 h1:zj2dxxmn8eORTRSqFUWV4WQxnwhFJ8PBN0eu/odLnFI= +github.com/redhat-cne/sdk-go v1.0.1-0.20240826142227-273e2055e3b6/go.mod h1:q9LxxPbK1tGpDbQm/KIPujqdP0bK1hhuHrIXV3vuUrM= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= diff --git a/vendor/github.com/redhat-cne/sdk-go/v1/subscriber/subscriber.go b/vendor/github.com/redhat-cne/sdk-go/v1/subscriber/subscriber.go index 2096aa1..a2aac0c 100644 --- a/vendor/github.com/redhat-cne/sdk-go/v1/subscriber/subscriber.go +++ b/vendor/github.com/redhat-cne/sdk-go/v1/subscriber/subscriber.go @@ -395,6 +395,14 @@ func (p *API) IncFailCountToFail(clientID uuid.UUID) bool { return false } +// ResetFailCount ..reset fail count +func (p *API) ResetFailCount(clientID uuid.UUID) { + if subStore, ok := p.SubscriberStore.Get(clientID); ok { + subStore.ResetFailCount() + p.SubscriberStore.Set(clientID, subStore) + } +} + // FailCountThreshold .. get threshold func (p *API) FailCountThreshold() int { return subscriber.SetConnectionToFailAfter diff --git a/vendor/modules.txt b/vendor/modules.txt index 4fc8807..f9fd131 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -71,7 +71,7 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/redhat-cne/sdk-go v1.0.1-0.20240816174822-51aca34ab94e +# github.com/redhat-cne/sdk-go v1.0.1-0.20240826142227-273e2055e3b6 ## explicit; go 1.22 github.com/redhat-cne/sdk-go/pkg/channel github.com/redhat-cne/sdk-go/pkg/common