mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 18:30:02 +08:00
chore: only upload metrics on mysql (#4591)
This commit is contained in:
@@ -27,6 +27,7 @@ func getCachedSqlConn(driverName, server string) (*sql.DB, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if driverName != mysqlDriverName {
|
||||||
if cfg, e := mysql.ParseDSN(server); e != nil {
|
if cfg, e := mysql.ParseDSN(server); e != nil {
|
||||||
// if cannot parse, don't collect the metrics
|
// if cannot parse, don't collect the metrics
|
||||||
logx.Error(e)
|
logx.Error(e)
|
||||||
@@ -41,6 +42,7 @@ func getCachedSqlConn(driverName, server string) (*sql.DB, error) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return conn, nil
|
return conn, nil
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user