@@ -16,6 +16,7 @@ import (
16
16
17
17
"github.com/alibaba/higress/api-server/pkg/options"
18
18
"github.com/alibaba/higress/api-server/pkg/utils"
19
+ "github.com/google/uuid"
19
20
"github.com/nacos-group/nacos-sdk-go/v2/clients/config_client"
20
21
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
21
22
"github.com/nacos-group/nacos-sdk-go/v2/model"
@@ -83,7 +84,7 @@ func NewNacosREST(
83
84
newFunc : newFunc ,
84
85
newListFunc : newListFunc ,
85
86
attrFunc : attrFunc ,
86
- watchers : make (map [int ]* nacosWatch , 10 ),
87
+ watchers : make (map [string ]* nacosWatch , 10 ),
87
88
encryptionKey : dataEncryptionKey ,
88
89
}
89
90
n .namesDataId = n .dataIdPrefix + dataIdSeparator + namesSuffix
@@ -104,7 +105,7 @@ type nacosREST struct {
104
105
listRefreshTicker * time.Ticker
105
106
listConfigListened int32
106
107
watchersMutex sync.RWMutex
107
- watchers map [int ]* nacosWatch
108
+ watchers map [string ]* nacosWatch
108
109
109
110
newFunc func () runtime.Object
110
111
newListFunc func () runtime.Object
@@ -446,7 +447,7 @@ func (n *nacosREST) Watch(ctx context.Context, options *metainternalversion.List
446
447
ns , _ := genericapirequest .NamespaceFrom (ctx )
447
448
predicate := n .buildListPredicate (options )
448
449
nw := & nacosWatch {
449
- id : len ( n . watchers ),
450
+ id : uuid . New (). String ( ),
450
451
f : n ,
451
452
ch : make (chan watch.Event , 1024 ),
452
453
ns : ns ,
@@ -738,7 +739,7 @@ func calculateMd5(str string) string {
738
739
739
740
type nacosWatch struct {
740
741
f * nacosREST
741
- id int
742
+ id string
742
743
ch chan watch.Event
743
744
ns string
744
745
predicate * storage.SelectionPredicate
0 commit comments