mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 16:04:19 +01: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:
parent
1da1c255f6
commit
cc37ec4030
2 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue