Skip to content

Commit

Permalink
🎨 Automatic check of database indexes is only performed once after st…
Browse files Browse the repository at this point in the history
…artup #10563
  • Loading branch information
88250 committed Mar 10, 2024
1 parent 9989d79 commit aeb09cb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion kernel/job/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func StartCron() {
go every(util.SQLFlushInterval, sql.FlushTxJob)
go every(util.SQLFlushInterval, sql.FlushHistoryTxJob)
go every(util.SQLFlushInterval, sql.FlushAssetContentTxJob)
go every(10*time.Minute, model.FixIndexJob)
go every(10*time.Minute, model.IndexEmbedBlockJob)
go every(10*time.Minute, model.CacheVirtualBlockRefJob)
go every(30*time.Second, model.OCRAssetsJob)
Expand Down
1 change: 1 addition & 0 deletions kernel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func main() {
util.PushClearAllMsg()

job.StartCron()
go model.CheckIndex()
go model.AutoGenerateDocHistory()
go cache.LoadAssets()
go util.CheckFileSysStatus()
Expand Down
1 change: 1 addition & 0 deletions kernel/mobile/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func StartKernel(container, appDir, workspaceBaseDir, timezoneID, localIPs, lang
util.PushClearAllMsg()

job.StartCron()
go model.CheckIndex()
go model.AutoGenerateDocHistory()
go cache.LoadAssets()
}()
Expand Down
4 changes: 2 additions & 2 deletions kernel/model/index_fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)

// FixIndexJob 自动校验数据库索引 https://github.com/siyuan-note/siyuan/issues/7016
func FixIndexJob() {
// CheckIndex 自动校验数据库索引 https://github.com/siyuan-note/siyuan/issues/7016 https://github.com/siyuan-note/siyuan/issues/10563
func CheckIndex() {
task.AppendTask(task.DatabaseIndexFix, removeDuplicateDatabaseIndex)
sql.WaitForWritingDatabase()

Expand Down

0 comments on commit aeb09cb

Please sign in to comment.