Sfoglia il codice sorgente

:recycle: 改进后台任务判断重复

Liang Ding 2 anni fa
parent
commit
7d7a198982
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1 1
      kernel/model/tree.go
  2. 1 1
      kernel/task/queue.go

+ 1 - 1
kernel/model/tree.go

@@ -157,7 +157,7 @@ func loadTreeByBlockID(id string) (ret *parse.Tree, err error) {
 
 	bt := treenode.GetBlockTree(id)
 	if nil == bt {
-		if task.ContainIndexTask(task.DatabaseIndex, task.DatabaseIndexFull) {
+		if task.Contain(task.DatabaseIndex, task.DatabaseIndexFull) {
 			err = ErrIndexing
 			return
 		}

+ 1 - 1
kernel/task/queue.go

@@ -85,7 +85,7 @@ const (
 	ReloadUI                = "task.reload.ui"                 // 重载 UI
 )
 
-func ContainIndexTask(action string, moreActions ...string) bool {
+func Contain(action string, moreActions ...string) bool {
 	actions := append(moreActions, action)
 	actions = gulu.Str.RemoveDuplicatedElem(actions)