|
|
@ -21,7 +21,6 @@ func MSConnect(DBHOST, DBUSER, DBPWD, DBNAME, DBPORT string, conns ...int) error |
|
|
|
if DBHOST != "" && DBUSER != "" && DBPWD != "" && DBPORT != "" { //&& DBNAME != ""
|
|
|
|
|
|
|
|
for i := 0; i < 10; i++ { |
|
|
|
time.Sleep(time.Second * 5) |
|
|
|
|
|
|
|
//连接字符串
|
|
|
|
|
|
|
@ -35,6 +34,7 @@ func MSConnect(DBHOST, DBUSER, DBPWD, DBNAME, DBPORT string, conns ...int) error |
|
|
|
|
|
|
|
if dbConnErr != nil { |
|
|
|
log.Println("ERROR", "can not connect to Database, ", dbConnErr) |
|
|
|
time.Sleep(time.Second * 5) |
|
|
|
} else { |
|
|
|
|
|
|
|
log.Println("msdb connected") |
|
|
|