fix activity timer on timeout = 0

pull/1132/head
Darien Raymond 7 years ago
parent 9321210bcf
commit 6dbe2644a9
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -44,7 +44,7 @@ func (t *ActivityTimer) finish() {
t.onTimeout() t.onTimeout()
} }
if t.checkTask != nil { if t.checkTask != nil {
t.checkTask.Close() t.checkTask.Close() // nolint: errcheck
t.checkTask = nil t.checkTask = nil
} }
} }
@ -52,6 +52,7 @@ func (t *ActivityTimer) finish() {
func (t *ActivityTimer) SetTimeout(timeout time.Duration) { func (t *ActivityTimer) SetTimeout(timeout time.Duration) {
if timeout == 0 { if timeout == 0 {
t.finish() t.finish()
return
} }
t.Lock() t.Lock()

Loading…
Cancel
Save