mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 11:57:51 +00:00
refactor same node URI check in SendSync
This commit is contained in:
parent
04790f70f2
commit
21072a665f
1 changed files with 8 additions and 6 deletions
14
server.go
14
server.go
|
|
@ -345,13 +345,15 @@ func (s *Server) SendSync(pb proto.Message) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Don't forward the message to ourselves
|
||||
if *s.URI != *uri {
|
||||
ctx := context.WithValue(context.Background(), "uri", uri)
|
||||
eg.Go(func() error {
|
||||
return s.defaultClient.ClusterMessage(ctx, pb)
|
||||
})
|
||||
// Don't forward the message to ourselves.
|
||||
if *s.URI == *uri {
|
||||
continue
|
||||
}
|
||||
|
||||
ctx := context.WithValue(context.Background(), "uri", uri)
|
||||
eg.Go(func() error {
|
||||
return s.defaultClient.ClusterMessage(ctx, pb)
|
||||
})
|
||||
}
|
||||
|
||||
return eg.Wait()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue