♻️ 改进后台任务判断重复

This commit is contained in:
Liang Ding 2023-01-28 16:18:16 +08:00
parent 4f717a81cb
commit 7d7a198982
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 2 additions and 2 deletions

View file

@ -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
}

View file

@ -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)