mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
8e6628cfa2
commit
e44bf92c63
1 changed files with 0 additions and 6 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue