mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
🎨 公测云端同步数据仓库 https://github.com/siyuan-note/siyuan/issues/5337
This commit is contained in:
parent
dc2e997b53
commit
67ffbc995a
1 changed files with 17 additions and 2 deletions
|
|
@ -436,6 +436,9 @@ func clearEmptyDirs(dir string) {
|
||||||
|
|
||||||
// incReindex 增量重建索引。
|
// incReindex 增量重建索引。
|
||||||
func incReindex(upserts, removes []string) {
|
func incReindex(upserts, removes []string) {
|
||||||
|
needPushUpsertProgress := 32 < len(upserts)
|
||||||
|
needPushRemoveProgress := 32 < len(removes)
|
||||||
|
|
||||||
for _, upsertFile := range upserts {
|
for _, upsertFile := range upserts {
|
||||||
if !strings.HasSuffix(upsertFile, ".sy") {
|
if !strings.HasSuffix(upsertFile, ".sy") {
|
||||||
continue
|
continue
|
||||||
|
|
@ -453,7 +456,11 @@ func incReindex(upserts, removes []string) {
|
||||||
}
|
}
|
||||||
treenode.ReindexBlockTree(tree)
|
treenode.ReindexBlockTree(tree)
|
||||||
sql.UpsertTreeQueue(tree)
|
sql.UpsertTreeQueue(tree)
|
||||||
//util.LogInfof("sync index tree [%s]", tree.ID)
|
msg := fmt.Sprintf("Sync reindex tree [%s]", tree.ID)
|
||||||
|
util.PushStatusBar(msg)
|
||||||
|
if needPushUpsertProgress {
|
||||||
|
util.PushEndlessProgress(msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for _, removeFile := range removes {
|
for _, removeFile := range removes {
|
||||||
if !strings.HasSuffix(removeFile, ".sy") {
|
if !strings.HasSuffix(removeFile, ".sy") {
|
||||||
|
|
@ -465,9 +472,17 @@ func incReindex(upserts, removes []string) {
|
||||||
if nil != block {
|
if nil != block {
|
||||||
treenode.RemoveBlockTreesByRootID(block.RootID)
|
treenode.RemoveBlockTreesByRootID(block.RootID)
|
||||||
sql.RemoveTreeQueue(block.BoxID, block.RootID)
|
sql.RemoveTreeQueue(block.BoxID, block.RootID)
|
||||||
//util.LogInfof("sync remove tree [%s]", block.RootID)
|
msg := fmt.Sprintf("Sync remove tree [%s]", block.RootID)
|
||||||
|
util.PushStatusBar(msg)
|
||||||
|
if needPushRemoveProgress {
|
||||||
|
util.PushEndlessProgress(msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if needPushRemoveProgress || needPushUpsertProgress {
|
||||||
|
util.PushClearProgress()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetCloudSyncDir(name string) {
|
func SetCloudSyncDir(name string) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue