mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-06 01:50:25 +08:00
优化数据库相关代码
This commit is contained in:
@@ -28,6 +28,9 @@ func TestSQLExecutor_checkCluster(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
_ = db.Close()
|
||||
}()
|
||||
|
||||
err = executor.checkCluster(db)
|
||||
if err != nil {
|
||||
@@ -46,6 +49,9 @@ func TestSQLExecutor_checkMetricItems(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
_ = db.Close()
|
||||
}()
|
||||
|
||||
err = executor.checkMetricItems(db)
|
||||
if err != nil {
|
||||
@@ -64,6 +70,9 @@ func TestSQLExecutor_checkNS(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
_ = db.Close()
|
||||
}()
|
||||
|
||||
err = executor.checkNS(db)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user