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