mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 06:28:06 +01:00
Fix TestTCPConn
break issue.
Signed-off-by: Colstuwjx <Colstuwjx@gmail.com>
This commit is contained in:
parent
f0f1c4ed0c
commit
e49a9de2f4
@ -89,10 +89,12 @@ func TestTCPConn(addr string, timeout, interval int) error {
|
||||
|
||||
go func() {
|
||||
n := 1
|
||||
|
||||
loop:
|
||||
for {
|
||||
select {
|
||||
case <-cancel:
|
||||
break
|
||||
break loop
|
||||
default:
|
||||
conn, err := net.DialTimeout("tcp", addr, time.Duration(n)*time.Second)
|
||||
if err != nil {
|
||||
@ -106,7 +108,7 @@ func TestTCPConn(addr string, timeout, interval int) error {
|
||||
log.Errorf("failed to close the connection: %v", err)
|
||||
}
|
||||
success <- 1
|
||||
break
|
||||
break loop
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user