fix: Remove sync task after finished (#38681)

Related to #38680

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/38694/head
congqixia 2024-12-24 13:34:48 +08:00 committed by GitHub
parent 877cd80d93
commit 636e107e44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -124,6 +124,10 @@ func (mgr *syncManager) safeSubmitTask(ctx context.Context, task Task, callbacks
func (mgr *syncManager) submit(ctx context.Context, key int64, task Task, callbacks ...func(error) error) *conc.Future[struct{}] {
handler := func(err error) error {
taskKey := fmt.Sprintf("%d-%d", task.SegmentID(), task.Checkpoint().GetTimestamp())
defer func() {
mgr.tasks.Remove(taskKey)
}()
if err == nil {
return nil
}