Commit c7f5c970 authored by hujiebin's avatar hujiebin

feat:启动的时候ping一下

parent 3cab22bb
......@@ -53,5 +53,8 @@ func init() {
d.SetConnMaxLifetime(time.Minute * 30) // 连接可复用的最大时间。
d.SetMaxIdleConns(50) // 空闲连接数
d.SetMaxOpenConns(50) // 最大连接数
if err := d.Ping(); err != nil {
fmt.Printf("database ping error %v", err)
}
}
}
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