fix(数据库): 修复默认分组缺失与迁移锁阻塞
通过迁移补种默认 groups 记录,避免新装空分组 迁移锁改为 try lock + 重试并加入超时 写入 usage_logs 时保留 rate_multiplier=0 语义 测试: go test ./...
This commit is contained in:
@@ -260,7 +260,9 @@ func initializeDatabase(cfg *SetupConfig) error {
|
||||
}
|
||||
}()
|
||||
|
||||
return infrastructure.ApplyMigrations(context.Background(), db)
|
||||
migrationCtx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
|
||||
defer cancel()
|
||||
return infrastructure.ApplyMigrations(migrationCtx, db)
|
||||
}
|
||||
|
||||
func createAdminUser(cfg *SetupConfig) error {
|
||||
|
||||
Reference in New Issue
Block a user