From 454f563bce8363dc49efbedda29832764df6dabb Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Wed, 31 Aug 2022 22:53:41 +0800 Subject: [PATCH] fix: task id not update --- pkg/task/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/task/manager.go b/pkg/task/manager.go index 3e98581e..68092fef 100644 --- a/pkg/task/manager.go +++ b/pkg/task/manager.go @@ -16,8 +16,8 @@ type Manager[K comparable] struct { func (tm *Manager[K]) Submit(task *Task[K]) K { if tm.updateID != nil { + tm.updateID(&tm.curID) task.ID = tm.curID - tm.updateID(&task.ID) } tm.tasks.Store(task.ID, task) tm.do(task)