Skip to content
Snippets Groups Projects
Commit 824b7544 authored by ale's avatar ale
Browse files

Fixed a logic error when merging remote updates in the status protocol

parent 441853b0
No related branches found
No related tags found
1 merge request!1v2.0
......@@ -138,13 +138,14 @@ func (m *statusManager) propagateStatus(ctx context.Context) error {
}
func (m *statusManager) mergeRemoteStatuses(remote []*pb.Status) {
if m.self != nil {
remote = withoutNode(remote, m.self.Name)
if len(remote) == 0 {
return
}
s := []*pb.Status{m.self}
if len(remote) > 0 {
adds := mergeNodes(m.statuses, remote)
s = append(s, adds...)
s := mergeNodes(m.statuses, remote)
if m.self != nil {
s = withoutNode(s, m.self.Name)
s = append([]*pb.Status{m.self}, s...)
}
m.statuses = s
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment