This commit is contained in:
风扇滑翔翼
2025-08-23 16:29:11 +00:00
committed by GitHub
parent ade3cf61e3
commit 7307390c3b

View File

@@ -14,8 +14,8 @@ type ActivityUpdater interface {
}
type ActivityTimer struct {
mu sync.RWMutex
updated chan struct{}
mu sync.RWMutex
updated chan struct{}
checkTask *task.Periodic
onTimeout func()
consumed bool
@@ -43,6 +43,9 @@ func (t *ActivityTimer) finish() {
t.mu.Lock()
defer t.mu.Unlock()
if t.checkTask != nil {
t.checkTask.Close()
}
t.onTimeout()
t.checkTask.Close()
t.consumed = true