mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-09 08:44:20 +01:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
3c79a226be
commit
f8ef5639c0
12 changed files with 40 additions and 29 deletions
|
|
@ -253,4 +253,16 @@ func init() {
|
|||
util.SetBootDetails(msg)
|
||||
util.ContextPushMsg(context, msg)
|
||||
})
|
||||
eventbus.Subscribe(eventbus.EvtSQLDeleteBlocks, func(context map[string]interface{}, rootID string) {
|
||||
if util.ContainerAndroid == util.Container || util.ContainerIOS == util.Container {
|
||||
// Android/iOS 端不显示数据索引和搜索索引状态提示 https://github.com/siyuan-note/siyuan/issues/6392
|
||||
return
|
||||
}
|
||||
|
||||
current := context["current"].(int) + 1
|
||||
total := context["total"]
|
||||
msg := fmt.Sprintf(Conf.Language(93), current, total, rootID)
|
||||
util.SetBootDetails(msg)
|
||||
util.ContextPushMsg(context, msg)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ func autoFixIndex() {
|
|||
for _, root := range roots {
|
||||
rootMap[root.ID] = root
|
||||
}
|
||||
var deletes int
|
||||
for _, rootID := range duplicatedRootIDs {
|
||||
root := rootMap[rootID]
|
||||
if nil == root {
|
||||
|
|
@ -77,13 +78,13 @@ func autoFixIndex() {
|
|||
|
||||
//logging.LogWarnf("exist more than one tree [%s], reindex it", rootID)
|
||||
sql.RemoveTreeQueue(root.Box, rootID)
|
||||
|
||||
deletes++
|
||||
if util.IsExiting {
|
||||
break
|
||||
}
|
||||
}
|
||||
if 0 < len(duplicatedRootIDs) {
|
||||
logging.LogWarnf("exist more than one tree duplicated [%d], reindex it", len(duplicatedRootIDs))
|
||||
if 0 < deletes {
|
||||
logging.LogWarnf("exist more than one tree duplicated [%d], reindex it", deletes)
|
||||
}
|
||||
|
||||
util.PushStatusBar(Conf.Language(58))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue