Skip to content

Commit

Permalink
Fix race in webtorrent.TrackerClient.Run
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Jun 1, 2020
1 parent 69a0f2f commit c3696aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webtorrent/tracker_client.go
Expand Up @@ -92,9 +92,11 @@ func (tc *TrackerClient) Run() error {
tc.mu.Unlock()
err := tc.doWebsocket()
level := log.Info
tc.mu.Lock()
if tc.closed {
level = log.Debug
}
tc.mu.Unlock()
tc.Logger.WithDefaultLevel(level).Printf("websocket instance ended: %v", err)
time.Sleep(time.Minute)
tc.mu.Lock()
Expand Down

0 comments on commit c3696aa

Please sign in to comment.