Merge pull request #136 from ywk253100/master

set timeout for creation of connection between UI and DB
This commit is contained in:
Daniel Jiang 2016-04-21 10:10:21 +08:00
commit 9ca056d243

View File

@ -77,7 +77,7 @@ func InitDB() {
var err error
var c net.Conn
for {
c, err = net.Dial("tcp", addr+":"+port)
c, err = net.DialTimeout("tcp", addr+":"+port, 20*time.Second)
if err == nil {
c.Close()
ch <- 1