mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 02:35:17 +01:00
set timeout for creation of connection between UI and DB
This commit is contained in:
parent
ba69666509
commit
b5b22350d1
@ -77,7 +77,7 @@ func InitDB() {
|
|||||||
var err error
|
var err error
|
||||||
var c net.Conn
|
var c net.Conn
|
||||||
for {
|
for {
|
||||||
c, err = net.Dial("tcp", addr+":"+port)
|
c, err = net.DialTimeout("tcp", addr+":"+port, 20*time.Second)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
c.Close()
|
c.Close()
|
||||||
ch <- 1
|
ch <- 1
|
||||||
|
Loading…
Reference in New Issue
Block a user