Commit f640df7a by Yuan Liu Committed by GitHub

simplify code

parent 36dbc5f5
......@@ -21,11 +21,9 @@ func init() {
func newMysqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoint, error) {
logger := log.New("tsdb.mysql")
var protocol string
protocol := "tcp"
if strings.HasPrefix(datasource.Url, "/") {
protocol = "unix"
} else {
protocol = "tcp"
}
cnnstr := fmt.Sprintf("%s:%s@%s(%s)/%s?collation=utf8mb4_unicode_ci&parseTime=true&loc=UTC&allowNativePasswords=true",
datasource.User,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment