@@ -24,8 +24,6 @@ import (
24
24
25
25
apiconfig "github.com/polarismesh/specification/source/go/api/v1/config_manage"
26
26
27
- "github.com/polarismesh/polaris/auth"
28
- "github.com/polarismesh/polaris/cache"
29
27
cachetypes "github.com/polarismesh/polaris/cache/api"
30
28
"github.com/polarismesh/polaris/common/model"
31
29
"github.com/polarismesh/polaris/common/utils"
@@ -73,7 +71,7 @@ type Server struct {
73
71
fileCache cachetypes.ConfigFileCache
74
72
groupCache cachetypes.ConfigGroupCache
75
73
grayCache cachetypes.GrayCache
76
- caches * cache .CacheManager
74
+ caches cachetypes .CacheManager
77
75
watchCenter * watchCenter
78
76
namespaceOperator namespace.NamespaceOperateServer
79
77
initialized bool
@@ -89,8 +87,8 @@ type Server struct {
89
87
}
90
88
91
89
// Initialize 初始化配置中心模块
92
- func Initialize (ctx context.Context , config Config , s store.Store , cacheMgn * cache .CacheManager ,
93
- namespaceOperator namespace.NamespaceOperateServer , userMgn auth. UserServer , strategyMgn auth. StrategyServer ) error {
90
+ func Initialize (ctx context.Context , config Config , s store.Store , cacheMgr cachetypes .CacheManager ,
91
+ namespaceOperator namespace.NamespaceOperateServer ) error {
94
92
if ! config .Open {
95
93
originServer .initialized = true
96
94
return nil
@@ -100,10 +98,10 @@ func Initialize(ctx context.Context, config Config, s store.Store, cacheMgn *cac
100
98
return nil
101
99
}
102
100
103
- if err := cacheMgn .OpenResourceCache (configCacheEntries ... ); err != nil {
101
+ if err := cacheMgr .OpenResourceCache (configCacheEntries ... ); err != nil {
104
102
return err
105
103
}
106
- err := originServer .initialize (ctx , config , s , namespaceOperator , cacheMgn )
104
+ err := originServer .initialize (ctx , config , s , namespaceOperator , cacheMgr )
107
105
if err != nil {
108
106
return err
109
107
}
@@ -128,19 +126,19 @@ func Initialize(ctx context.Context, config Config, s store.Store, cacheMgn *cac
128
126
}
129
127
130
128
func (s * Server ) initialize (ctx context.Context , config Config , ss store.Store ,
131
- namespaceOperator namespace.NamespaceOperateServer , cacheMgn * cache .CacheManager ) error {
129
+ namespaceOperator namespace.NamespaceOperateServer , cacheMgr cachetypes .CacheManager ) error {
132
130
var err error
133
131
s .cfg = & config
134
132
if s .cfg .ContentMaxLength <= 0 {
135
133
s .cfg .ContentMaxLength = fileContentMaxLength
136
134
}
137
135
s .storage = ss
138
136
s .namespaceOperator = namespaceOperator
139
- s .fileCache = cacheMgn .ConfigFile ()
140
- s .groupCache = cacheMgn .ConfigGroup ()
141
- s .grayCache = cacheMgn .Gray ()
137
+ s .fileCache = cacheMgr .ConfigFile ()
138
+ s .groupCache = cacheMgr .ConfigGroup ()
139
+ s .grayCache = cacheMgr .Gray ()
142
140
143
- s .watchCenter , err = NewWatchCenter (cacheMgn )
141
+ s .watchCenter , err = NewWatchCenter (cacheMgr )
144
142
if err != nil {
145
143
return err
146
144
}
@@ -156,7 +154,7 @@ func (s *Server) initialize(ctx context.Context, config Config, ss store.Store,
156
154
log .Warnf ("Not Found Crypto Plugin" )
157
155
}
158
156
159
- s .caches = cacheMgn
157
+ s .caches = cacheMgr
160
158
s .chains = newConfigChains (s , []ConfigFileChain {
161
159
& CryptoConfigFileChain {},
162
160
& ReleaseConfigFileChain {},
0 commit comments