优化本地数据库相关代码

This commit is contained in:
GoEdgeLab
2023-10-06 20:56:27 +08:00
parent 1a7cd63478
commit 28966d6f2d
7 changed files with 28 additions and 9 deletions

View File

@@ -91,7 +91,7 @@ func (this *Task) Init() error {
var path = dir + "/metric." + types.String(this.item.Id) + ".db"
db, err := dbs.OpenWriter("file:" + path + "?cache=shared&mode=rwc&_journal_mode=WAL&_sync=NORMAL&_locking_mode=EXCLUSIVE")
db, err := dbs.OpenWriter("file:" + path + "?cache=shared&mode=rwc&_journal_mode=WAL&_sync=" + dbs.SyncMode + "&_locking_mode=EXCLUSIVE")
if err != nil {
return err
}