使用版本号来读取节点任务,提升任务同步稳定性

This commit is contained in:
GoEdgeLab
2022-11-06 12:03:11 +08:00
parent d916468974
commit 4cadf38c98
6 changed files with 75 additions and 17 deletions

View File

@@ -251,3 +251,22 @@ func TestUpgradeSQLData_v0_5_3(t *testing.T) {
}
t.Log("ok")
}
func TestUpgradeSQLData_v0_5_7(t *testing.T) {
db, err := dbs.NewInstanceFromConfig(&dbs.DBConfig{
Driver: "mysql",
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge?charset=utf8mb4&timeout=30s",
Prefix: "edge",
})
if err != nil {
t.Fatal(err)
}
defer func() {
_ = db.Close()
}()
err = upgradeV0_5_7(db)
if err != nil {
t.Fatal(err)
}
t.Log("ok")
}