mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
consensus: fix race
This commit is contained in:
parent
1a23081336
commit
ebf4034ec7
1 changed files with 2 additions and 0 deletions
|
@ -212,6 +212,7 @@ func (s *service) streamReader() error {
|
|||
if len(events) == 0 {
|
||||
return s.stream.Err()
|
||||
}
|
||||
s.mu.Lock()
|
||||
for _, e := range events {
|
||||
if w, ok := s.watchers[e.LogId]; ok {
|
||||
if e.Error == nil {
|
||||
|
@ -223,6 +224,7 @@ func (s *service) streamReader() error {
|
|||
log.Warn("received unexpected log id", zap.String("logId", e.LogId))
|
||||
}
|
||||
}
|
||||
s.mu.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue