mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
7ef54b0f8f
commit
3f518547f8
1 changed files with 12 additions and 1 deletions
|
|
@ -972,18 +972,29 @@ func syncRepo(exit, byHand bool) (err error) {
|
||||||
// 有数据变更,需要重建索引
|
// 有数据变更,需要重建索引
|
||||||
var upserts, removes []string
|
var upserts, removes []string
|
||||||
var upsertTrees int
|
var upsertTrees int
|
||||||
|
var needReloadFlashcard bool
|
||||||
for _, file := range mergeResult.Upserts {
|
for _, file := range mergeResult.Upserts {
|
||||||
upserts = append(upserts, file.Path)
|
upserts = append(upserts, file.Path)
|
||||||
|
if strings.HasPrefix(file.Path, "/storage/riff/") {
|
||||||
|
needReloadFlashcard = true
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(file.Path, ".sy") {
|
if strings.HasSuffix(file.Path, ".sy") {
|
||||||
upsertTrees++
|
upsertTrees++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, file := range mergeResult.Removes {
|
for _, file := range mergeResult.Removes {
|
||||||
removes = append(removes, file.Path)
|
removes = append(removes, file.Path)
|
||||||
|
if strings.HasPrefix(file.Path, "/storage/riff/") {
|
||||||
|
needReloadFlashcard = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if needReloadFlashcard {
|
||||||
|
InitFlashcards()
|
||||||
}
|
}
|
||||||
|
|
||||||
cache.ClearDocsIAL() // 同步后文档树文档图标没有更新 https://github.com/siyuan-note/siyuan/issues/4939
|
cache.ClearDocsIAL() // 同步后文档树文档图标没有更新 https://github.com/siyuan-note/siyuan/issues/4939
|
||||||
|
|
||||||
if needFullReindex(upsertTrees) { // 改进同步后全量重建索引判断 https://github.com/siyuan-note/siyuan/issues/5764
|
if needFullReindex(upsertTrees) { // 改进同步后全量重建索引判断 https://github.com/siyuan-note/siyuan/issues/5764
|
||||||
FullReindex()
|
FullReindex()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue