master
兔子 2 years ago
parent da855c1b29
commit d86ca51672

@ -183,6 +183,12 @@ func (r *Remind) GetTasksByKey(key string) []Task {
return res return res
} }
func (r *Remind) GetTaskByID(id int) Task {
r.mu.RLock()
defer r.mu.RUnlock()
return r.tasks[id]
}
func (r *Remind) Stop() error { func (r *Remind) Stop() error {
for _, task := range r.tasks { for _, task := range r.tasks {
task.GetTimer().Stop() task.GetTimer().Stop()

Loading…
Cancel
Save