Closure On change of state

This commit is contained in:
mr
2026-02-05 16:17:14 +01:00
parent 2e31df89c2
commit ea14ad3933
3 changed files with 48 additions and 9 deletions

View File

@@ -91,8 +91,8 @@ func (ps *StreamService) ToPartnerPublishEvent(
if err != nil {
return err
}
ps.mu.Lock()
defer ps.mu.Unlock()
ps.Mu.Lock()
defer ps.Mu.Unlock()
if p.Relation == peer.PARTNER {
if ps.Streams[ProtocolHeartbeatPartner] == nil {
ps.Streams[ProtocolHeartbeatPartner] = map[pp.ID]*common.Stream{}
@@ -138,8 +138,8 @@ func (s *StreamService) write(
if dt != nil {
name = action.String() + "." + (*dt).String() + "#" + peerID.ID.String()
}
s.mu.Lock()
defer s.mu.Unlock()
s.Mu.Lock()
defer s.Mu.Unlock()
if s.Streams[proto] == nil {
s.Streams[proto] = map[pp.ID]*common.Stream{}
}