Ver a proveniência

Fix dangling goroutine on session expiration

The timer channel may already have been drained by `case <-timer.C`. In
this case, we need not to drain it again or we'll block forever.

To fix this, stop draining the timer channel. Since we're not going to
use the timer again anyway, it should be fine.
master
Simon Ser há 4 anos
ascendente
cometimento
e6e457e4a7
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: FDE7BE0E88F5E48
1 ficheiros alterados com 1 adições e 3 eliminações
  1. +1
    -3
      session.go

+ 1
- 3
session.go Ver ficheiro

@@ -237,9 +237,7 @@ func (sm *SessionManager) Put(username, password string) (*Session, error) {
}
}

if !timer.Stop() {
<-timer.C
}
timer.Stop()

s.locker.Lock()
if s.imapConn != nil {


Carregando…
Cancelar
Guardar