feat: 数据库添加_txlock=immediate参数

This commit is contained in:
耗子
2025-06-17 20:03:07 +08:00
parent a053a4212a
commit 6cf4e0c0cc
+1 -1
View File
@@ -17,7 +17,7 @@ import (
func NewDB(conf *koanf.Koanf, log *slog.Logger) (*gorm.DB, error) {
// You can use any other database, like MySQL or PostgreSQL.
return gorm.Open(gormlite.Open(filepath.Join(app.Root, "panel/storage/app.db")), &gorm.Config{
return gorm.Open(gormlite.Open(filepath.Join(app.Root, "panel/storage/app.db?_txlock=immediate")), &gorm.Config{
Logger: sloggorm.New(sloggorm.WithHandler(log.Handler())),
SkipDefaultTransaction: true,
DisableForeignKeyConstraintWhenMigrating: true,