Fix race in webtorrent.TrackerClient.Run
This commit is contained in:
parent
69a0f2f1e4
commit
c3696aa5a4
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue