From d86ca516722e7f6db6d591fe25e40181b291e246 Mon Sep 17 00:00:00 2001 From: starainrt Date: Thu, 18 May 2023 17:19:26 +0800 Subject: [PATCH] update --- remind/remind.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/remind/remind.go b/remind/remind.go index f3a0004..e6423d2 100644 --- a/remind/remind.go +++ b/remind/remind.go @@ -183,6 +183,12 @@ func (r *Remind) GetTasksByKey(key string) []Task { 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 { for _, task := range r.tasks { task.GetTimer().Stop()