mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
♻️ 改进后台任务判断重复
This commit is contained in:
parent
4f717a81cb
commit
7d7a198982
2 changed files with 2 additions and 2 deletions
|
|
@ -157,7 +157,7 @@ func loadTreeByBlockID(id string) (ret *parse.Tree, err error) {
|
||||||
|
|
||||||
bt := treenode.GetBlockTree(id)
|
bt := treenode.GetBlockTree(id)
|
||||||
if nil == bt {
|
if nil == bt {
|
||||||
if task.ContainIndexTask(task.DatabaseIndex, task.DatabaseIndexFull) {
|
if task.Contain(task.DatabaseIndex, task.DatabaseIndexFull) {
|
||||||
err = ErrIndexing
|
err = ErrIndexing
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ const (
|
||||||
ReloadUI = "task.reload.ui" // 重载 UI
|
ReloadUI = "task.reload.ui" // 重载 UI
|
||||||
)
|
)
|
||||||
|
|
||||||
func ContainIndexTask(action string, moreActions ...string) bool {
|
func Contain(action string, moreActions ...string) bool {
|
||||||
actions := append(moreActions, action)
|
actions := append(moreActions, action)
|
||||||
actions = gulu.Str.RemoveDuplicatedElem(actions)
|
actions = gulu.Str.RemoveDuplicatedElem(actions)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue