fix: task id not update

This commit is contained in:
Noah Hsu 2022-08-31 22:53:41 +08:00
parent 755f4b83f6
commit 454f563bce

View File

@ -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)