mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 08:48:49 +01:00
🎨 Auto rebuild history database index when indexing failed https://github.com/siyuan-note/siyuan/issues/8543
This commit is contained in:
parent
47df8b6018
commit
f7d8a02138
3 changed files with 14 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ import (
|
|||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/88250/lute/render"
|
||||
"github.com/siyuan-note/eventbus"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/conf"
|
||||
|
|
@ -691,3 +692,13 @@ func fromSQLHistories(sqlHistories []*sql.History) (ret []*HistoryItem) {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
func init() {
|
||||
subscribeSQLHistoryEvents()
|
||||
}
|
||||
|
||||
func subscribeSQLHistoryEvents() {
|
||||
eventbus.Subscribe(util.EvtSQLHistoryRebuild, func() {
|
||||
ReindexHistory()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue