🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

This commit is contained in:
Liang Ding 2023-01-24 15:21:23 +08:00
parent 1da37af586
commit 1a00b75192
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D
2 changed files with 0 additions and 31 deletions

View File

@ -495,9 +495,6 @@ func fullReindex() {
}
treenode.InitBlockTree(true)
sql.IndexMode()
defer sql.NormalMode()
openedBoxes := Conf.GetOpenedBoxes()
for _, openedBox := range openedBoxes {
index(openedBox.ID)

View File

@ -206,34 +206,6 @@ func initHistoryDBTables() {
}
}
func IndexMode() {
if nil != db {
db.Close()
}
dsn := util.DBPath + "?_journal_mode=OFF" +
"&_synchronous=OFF" +
"&_secure_delete=OFF" +
"&_cache_size=-20480" +
"&_page_size=8192" +
"&_busy_timeout=7000" +
"&_ignore_check_constraints=ON" +
"&_temp_store=MEMORY" +
"&_case_sensitive_like=OFF" +
"&_locking_mode=EXCLUSIVE"
var err error
db, err = sql.Open("sqlite3_extended", dsn)
if nil != err {
logging.LogFatalf("create database failed: %s", err)
}
db.SetMaxIdleConns(1)
db.SetMaxOpenConns(1)
db.SetConnMaxLifetime(365 * 24 * time.Hour)
}
func NormalMode() {
initDBConnection()
}
func initDBConnection() {
if nil != db {
db.Close()