Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/logic/server/getServerConfigLogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ func (l *GetServerConfigLogic) GetServerConfig(req *types.GetServerConfigRequest
}
var cfg map[string]interface{}
for _, protocol := range protocols {
if protocol.Type == protocolRequest {
if protocol.Enable && protocol.Type == protocolRequest {
cfg = l.compatible(protocol)
break
}
}

if cfg == nil {
return nil, fmt.Errorf("protocol %s not found or disabled", req.Protocol)
}

resp = &types.GetServerConfigResponse{
Basic: types.ServerBasic{
PullInterval: l.svcCtx.Config.Node.NodePullInterval,
Expand Down
9 changes: 9 additions & 0 deletions internal/logic/server/queryServerProtocolConfigLogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ func (l *QueryServerProtocolConfigLogic) QueryServerProtocolConfig(req *types.Qu
}
tool.DeepCopy(&protocols, dst)

// only return enabled protocols for node distribution
var enabledProtocols []types.Protocol
for _, p := range protocols {
if p.Enable {
enabledProtocols = append(enabledProtocols, p)
}
}
protocols = enabledProtocols

// filter by req.Protocols

if len(req.Protocols) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion internal/model/node/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (m *customServerModel) ClearNodeCache(ctx context.Context, params *FilterNo
return err
}
if len(keys) > 0 {
cacheKeys = append(keys, keys...)
cacheKeys = append(cacheKeys, keys...)
}
cursor = newCursor
if cursor == 0 {
Expand Down