This commit is contained in:
Fangliding
2026-11-23 02:29:56 +08:00
parent 3ff9cec713
commit 8d6509bdcd
6 changed files with 21 additions and 32 deletions
+3 -7
View File
@@ -58,15 +58,11 @@ func (t *Periodic) Start() error {
return nil
}
t.running = true
t.timer = time.AfterFunc(t.Interval, func() {
t.checkedExecute()
})
t.access.Unlock()
if err := t.checkedExecute(); err != nil {
t.access.Lock()
t.running = false
t.access.Unlock()
return err
}
return nil
}