Ver código fonte

:art: 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

Liang Ding 2 anos atrás
pai
commit
e44bf92c63
1 arquivos alterados com 0 adições e 6 exclusões
  1. 0 6
      kernel/task/queue.go

+ 0 - 6
kernel/task/queue.go

@@ -52,7 +52,6 @@ func PrependTask(action string, handler interface{}, args ...interface{}) {
 		return
 		return
 	}
 	}
 
 
-	cancelTask(action)
 	taskQueue = append([]*Task{newTask(action, handler, args...)}, taskQueue...)
 	taskQueue = append([]*Task{newTask(action, handler, args...)}, taskQueue...)
 }
 }
 
 
@@ -65,7 +64,6 @@ func AppendTask(action string, handler interface{}, args ...interface{}) {
 		return
 		return
 	}
 	}
 
 
-	cancelTask(action)
 	taskQueue = append(taskQueue, newTask(action, handler, args...))
 	taskQueue = append(taskQueue, newTask(action, handler, args...))
 }
 }
 
 
@@ -73,10 +71,6 @@ func CancelTask(actions ...string) {
 	queueLock.Lock()
 	queueLock.Lock()
 	defer queueLock.Unlock()
 	defer queueLock.Unlock()
 
 
-	cancelTask(actions...)
-}
-
-func cancelTask(actions ...string) {
 	for i := len(taskQueue) - 1; i >= 0; i-- {
 	for i := len(taskQueue) - 1; i >= 0; i-- {
 		task := taskQueue[i]
 		task := taskQueue[i]
 		for _, action := range actions {
 		for _, action := range actions {