mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-03 00:47:02 +00:00
🎨 Improve data indexing to reduce disk read operations https://github.com/siyuan-note/siyuan/issues/16958
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
@@ -46,6 +46,7 @@ func StartCron() {
|
||||
go every(30*time.Second, model.HookDesktopUIProcJob)
|
||||
go every(24*time.Hour, model.AutoPurgeRepoJob)
|
||||
go every(30*time.Minute, model.AutoCheckMicrosoftDefenderJob)
|
||||
go every(24*time.Hour, model.ClearOutdatedHistoryDirJob)
|
||||
|
||||
// TODO: 移除旧方案 https://github.com/siyuan-note/siyuan/issues/14414 实现新的刷新机制
|
||||
//go every(3*time.Second, model.WatchLocalShorthands)
|
||||
|
||||
@@ -77,7 +77,6 @@ func GenerateFileHistory() {
|
||||
generateAssetsHistory()
|
||||
|
||||
historyDir := util.HistoryDir
|
||||
clearOutdatedHistoryDir(historyDir)
|
||||
|
||||
// 以下部分是老版本的历史数据,不再保留
|
||||
for _, box := range Conf.GetBoxes() {
|
||||
@@ -683,7 +682,12 @@ func (box *Box) generateDocHistory0() {
|
||||
return
|
||||
}
|
||||
|
||||
func clearOutdatedHistoryDir(historyDir string) {
|
||||
func ClearOutdatedHistoryDirJob() {
|
||||
clearOutdatedHistoryDir()
|
||||
}
|
||||
|
||||
func clearOutdatedHistoryDir() {
|
||||
historyDir := util.HistoryDir
|
||||
if !gulu.File.IsExist(historyDir) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user