mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Prevent syncMergeResult push nil
This commit is contained in:
parent
ff8ee3713f
commit
52b400c793
1 changed files with 15 additions and 0 deletions
|
|
@ -279,6 +279,13 @@ func incReindex(upserts, removes []string) (upsertRootIDs, removeRootIDs []strin
|
||||||
util.IncBootProgress(3, "Sync reindexing...")
|
util.IncBootProgress(3, "Sync reindexing...")
|
||||||
removeRootIDs = removeIndexes(removes) // 先执行 remove,否则移动文档时 upsert 会被忽略,导致未被索引
|
removeRootIDs = removeIndexes(removes) // 先执行 remove,否则移动文档时 upsert 会被忽略,导致未被索引
|
||||||
upsertRootIDs = upsertIndexes(upserts)
|
upsertRootIDs = upsertIndexes(upserts)
|
||||||
|
|
||||||
|
if 1 > len(removeRootIDs) {
|
||||||
|
removeRootIDs = []string{}
|
||||||
|
}
|
||||||
|
if 1 > len(upsertRootIDs) {
|
||||||
|
upsertRootIDs = []string{}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -301,6 +308,10 @@ func removeIndexes(removeFilePaths []string) (removeRootIDs []string) {
|
||||||
sql.RemoveTreeQueue(block.BoxID, block.RootID)
|
sql.RemoveTreeQueue(block.BoxID, block.RootID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if 1 > len(removeRootIDs) {
|
||||||
|
removeRootIDs = []string{}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -336,6 +347,10 @@ func upsertIndexes(upsertFilePaths []string) (upsertRootIDs []string) {
|
||||||
sql.UpsertTreeQueue(tree)
|
sql.UpsertTreeQueue(tree)
|
||||||
upsertRootIDs = append(upsertRootIDs, tree.Root.ID)
|
upsertRootIDs = append(upsertRootIDs, tree.Root.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if 1 > len(upsertRootIDs) {
|
||||||
|
upsertRootIDs = []string{}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue