Swap execution flow order in enqueue (#21845)

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
pull/21862/head
smellthemoon 2023-01-30 10:27:50 +08:00 committed by GitHub
parent 73c44d4b29
commit bb086f47e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -227,12 +227,13 @@ type dmTaskQueue struct {
func (queue *dmTaskQueue) Enqueue(t task) error {
queue.statsLock.Lock()
defer queue.statsLock.Unlock()
err := queue.baseTaskQueue.Enqueue(t)
err := queue.addPChanStats(t)
if err != nil {
return err
}
err = queue.addPChanStats(t)
err = queue.baseTaskQueue.Enqueue(t)
if err != nil {
queue.popPChanStats(t)
return err
}