mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
♻️ 重命名重建索引函数
This commit is contained in:
parent
e2e929538b
commit
67ff76c605
6 changed files with 11 additions and 11 deletions
|
|
@ -55,7 +55,7 @@ func refreshFiletree(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
model.RefreshFileTree()
|
||||
model.FullReindex()
|
||||
}
|
||||
|
||||
func doc2Heading(c *gin.Context) {
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ func setSearch(c *gin.Context) {
|
|||
model.Conf.Save()
|
||||
sql.SetCaseSensitive(s.CaseSensitive)
|
||||
if s.CaseSensitive != oldCaseSensitive {
|
||||
model.RefreshFileTree()
|
||||
model.FullReindex()
|
||||
}
|
||||
sql.ClearVirtualRefKeywords()
|
||||
ret.Data = s
|
||||
|
|
|
|||
|
|
@ -483,10 +483,10 @@ func ReindexTree(path string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func RefreshFileTree() {
|
||||
func FullReindex() {
|
||||
util.PushEndlessProgress(Conf.Language(35))
|
||||
WaitForWritingFiles()
|
||||
|
||||
util.PushEndlessProgress(Conf.Language(35))
|
||||
if err := sql.InitDatabase(true); nil != err {
|
||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(85), err), 5000)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
|||
}
|
||||
writingDataLock.Unlock()
|
||||
|
||||
RefreshFileTree()
|
||||
FullReindex()
|
||||
IncSync()
|
||||
return nil
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ func RollbackNotebookHistory(historyPath string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
RefreshFileTree()
|
||||
FullReindex()
|
||||
IncSync()
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
}
|
||||
|
||||
IncSync()
|
||||
RefreshFileTree()
|
||||
FullReindex()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ func ImportData(zipPath string) (err error) {
|
|||
}
|
||||
|
||||
IncSync()
|
||||
RefreshFileTree()
|
||||
FullReindex()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -518,7 +518,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
}
|
||||
|
||||
IncSync()
|
||||
RefreshFileTree()
|
||||
FullReindex()
|
||||
} else { // 导入单个文件
|
||||
fileName := filepath.Base(localPath)
|
||||
if !strings.HasSuffix(fileName, ".md") && !strings.HasSuffix(fileName, ".markdown") {
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ func CheckoutRepo(id string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
RefreshFileTree()
|
||||
FullReindex()
|
||||
if syncEnabled {
|
||||
func() {
|
||||
time.Sleep(5 * time.Second)
|
||||
|
|
@ -616,7 +616,7 @@ func syncRepo(boot, exit, byHand bool) (err error) {
|
|||
cache.ClearDocsIAL() // 同步后文档树文档图标没有更新 https://github.com/siyuan-note/siyuan/issues/4939
|
||||
|
||||
if needFullReindex(upsertTrees) { // 改进同步后全量重建索引判断 https://github.com/siyuan-note/siyuan/issues/5764
|
||||
RefreshFileTree()
|
||||
FullReindex()
|
||||
return
|
||||
}
|
||||
incReindex(upserts, removes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue