mirror of
https://github.com/alibaba/higress.git
synced 2026-05-28 22:57:31 +08:00
fix too much logs when nacos is not avaiable (#2469)
This commit is contained in:
@@ -141,12 +141,13 @@ func (n *NacosRegistryClient) listMcpServerConfigs() ([]model.ConfigItem, error)
|
|||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mcpServerLog.Errorf("List mcp server configs for page size %d, page number %d error %v", currentPageNum, DefaultNacosListConfigPageSize)
|
mcpServerLog.Errorf("List mcp server configs for page size %d, page number %d error %v", currentPageNum, DefaultNacosListConfigPageSize, err)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if configPage == nil {
|
if configPage == nil {
|
||||||
mcpServerLog.Errorf("List mcp server configs for page size %d, page number %d null %v", currentPageNum, DefaultNacosListConfigPageSize)
|
mcpServerLog.Errorf("List mcp server configs for page size %d, page number %d null", currentPageNum, DefaultNacosListConfigPageSize)
|
||||||
continue
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
result = append(result, configPage.PageItems...)
|
result = append(result, configPage.PageItems...)
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ const (
|
|||||||
DefaultNacosCacheDir = "/var/log/nacos/log/mcp/cache"
|
DefaultNacosCacheDir = "/var/log/nacos/log/mcp/cache"
|
||||||
DefaultNacosNotLoadCache = true
|
DefaultNacosNotLoadCache = true
|
||||||
DefaultNacosLogMaxAge = 3
|
DefaultNacosLogMaxAge = 3
|
||||||
|
DefaultNacosLogMaxSize = 64
|
||||||
|
DefaultNacosLogMaxBackups = 3
|
||||||
DefaultRefreshInterval = time.Second * 30
|
DefaultRefreshInterval = time.Second * 30
|
||||||
DefaultRefreshIntervalLimit = time.Second * 10
|
DefaultRefreshIntervalLimit = time.Second * 10
|
||||||
)
|
)
|
||||||
@@ -128,6 +130,8 @@ func NewWatcher(cache memory.Cache, opts ...WatcherOption) (provider.Watcher, er
|
|||||||
constant.WithNotLoadCacheAtStart(DefaultNacosNotLoadCache),
|
constant.WithNotLoadCacheAtStart(DefaultNacosNotLoadCache),
|
||||||
constant.WithLogRollingConfig(&constant.ClientLogRollingConfig{
|
constant.WithLogRollingConfig(&constant.ClientLogRollingConfig{
|
||||||
MaxAge: DefaultNacosLogMaxAge,
|
MaxAge: DefaultNacosLogMaxAge,
|
||||||
|
MaxSize: DefaultNacosLogMaxSize,
|
||||||
|
MaxBackups: DefaultNacosLogMaxBackups,
|
||||||
}),
|
}),
|
||||||
constant.WithUpdateCacheWhenEmpty(w.updateCacheWhenEmpty),
|
constant.WithUpdateCacheWhenEmpty(w.updateCacheWhenEmpty),
|
||||||
constant.WithNamespaceId(w.NacosNamespaceId),
|
constant.WithNamespaceId(w.NacosNamespaceId),
|
||||||
|
|||||||
Reference in New Issue
Block a user