Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 3e834a4

Browse files
author
jonas747
committed
don't hold lock during send
1 parent 8c891c7 commit 3e834a4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

gateway.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,14 +828,12 @@ func (s *Session) UpdateListeningStatus(game string) (err error) {
828828
}
829829

830830
func (s *Session) UpdateStatusComplex(usd UpdateStatusData) (err error) {
831-
s.GatewayManager.mu.RLock()
832-
defer s.GatewayManager.mu.RUnlock()
833-
834-
if s.GatewayManager.currentConnection == nil {
835-
return errors.New("No gateway connection")
831+
curConn := s.GatewayManager.GetCurrentConnection()
832+
if curConn == nil {
833+
return errors.New("no gateway connection")
836834
}
837835

838-
s.GatewayManager.currentConnection.UpdateStatusComplex(usd)
836+
curConn.UpdateStatusComplex(usd)
839837
return nil
840838
}
841839

0 commit comments

Comments
 (0)