mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +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()
|
ret := gulu.Ret.NewResult()
|
||||||
defer c.JSON(http.StatusOK, ret)
|
defer c.JSON(http.StatusOK, ret)
|
||||||
|
|
||||||
model.RefreshFileTree()
|
model.FullReindex()
|
||||||
}
|
}
|
||||||
|
|
||||||
func doc2Heading(c *gin.Context) {
|
func doc2Heading(c *gin.Context) {
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ func setSearch(c *gin.Context) {
|
||||||
model.Conf.Save()
|
model.Conf.Save()
|
||||||
sql.SetCaseSensitive(s.CaseSensitive)
|
sql.SetCaseSensitive(s.CaseSensitive)
|
||||||
if s.CaseSensitive != oldCaseSensitive {
|
if s.CaseSensitive != oldCaseSensitive {
|
||||||
model.RefreshFileTree()
|
model.FullReindex()
|
||||||
}
|
}
|
||||||
sql.ClearVirtualRefKeywords()
|
sql.ClearVirtualRefKeywords()
|
||||||
ret.Data = s
|
ret.Data = s
|
||||||
|
|
|
||||||
|
|
@ -483,10 +483,10 @@ func ReindexTree(path string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func RefreshFileTree() {
|
func FullReindex() {
|
||||||
|
util.PushEndlessProgress(Conf.Language(35))
|
||||||
WaitForWritingFiles()
|
WaitForWritingFiles()
|
||||||
|
|
||||||
util.PushEndlessProgress(Conf.Language(35))
|
|
||||||
if err := sql.InitDatabase(true); nil != err {
|
if err := sql.InitDatabase(true); nil != err {
|
||||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(85), err), 5000)
|
util.PushErrMsg(fmt.Sprintf(Conf.Language(85), err), 5000)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
||||||
}
|
}
|
||||||
writingDataLock.Unlock()
|
writingDataLock.Unlock()
|
||||||
|
|
||||||
RefreshFileTree()
|
FullReindex()
|
||||||
IncSync()
|
IncSync()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -321,7 +321,7 @@ func RollbackNotebookHistory(historyPath string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
RefreshFileTree()
|
FullReindex()
|
||||||
IncSync()
|
IncSync()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
IncSync()
|
IncSync()
|
||||||
RefreshFileTree()
|
FullReindex()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -343,7 +343,7 @@ func ImportData(zipPath string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
IncSync()
|
IncSync()
|
||||||
RefreshFileTree()
|
FullReindex()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -518,7 +518,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
IncSync()
|
IncSync()
|
||||||
RefreshFileTree()
|
FullReindex()
|
||||||
} else { // 导入单个文件
|
} else { // 导入单个文件
|
||||||
fileName := filepath.Base(localPath)
|
fileName := filepath.Base(localPath)
|
||||||
if !strings.HasSuffix(fileName, ".md") && !strings.HasSuffix(fileName, ".markdown") {
|
if !strings.HasSuffix(fileName, ".md") && !strings.HasSuffix(fileName, ".markdown") {
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ func CheckoutRepo(id string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
RefreshFileTree()
|
FullReindex()
|
||||||
if syncEnabled {
|
if syncEnabled {
|
||||||
func() {
|
func() {
|
||||||
time.Sleep(5 * time.Second)
|
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
|
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
|
||||||
RefreshFileTree()
|
FullReindex()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
incReindex(upserts, removes)
|
incReindex(upserts, removes)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue