mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
enhance: Use channel name map finding channel watcher (#34294)
See also #33235 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
734415b8a2
commit
e083d99dd9
@ -384,20 +384,19 @@ func (m *ChannelManagerImplV2) FindWatcher(channel string) (UniqueID, error) {
|
||||
|
||||
infos := m.store.GetNodesChannels()
|
||||
for _, info := range infos {
|
||||
for _, channelInfo := range info.Channels {
|
||||
if channelInfo.GetName() == channel {
|
||||
return info.NodeID, nil
|
||||
}
|
||||
_, ok := info.Channels[channel]
|
||||
if ok {
|
||||
return info.NodeID, nil
|
||||
}
|
||||
}
|
||||
|
||||
// channel in buffer
|
||||
bufferInfo := m.store.GetBufferChannelInfo()
|
||||
for _, channelInfo := range bufferInfo.Channels {
|
||||
if channelInfo.GetName() == channel {
|
||||
return bufferID, errChannelInBuffer
|
||||
}
|
||||
_, ok := bufferInfo.Channels[channel]
|
||||
if ok {
|
||||
return bufferID, errChannelInBuffer
|
||||
}
|
||||
|
||||
return 0, errChannelNotWatched
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user