diff --git a/ocis-pkg/handlers/checktcp.go b/ocis-pkg/handlers/checktcp.go index a09e6570cd6..0db97bfabf8 100644 --- a/ocis-pkg/handlers/checktcp.go +++ b/ocis-pkg/handlers/checktcp.go @@ -3,12 +3,13 @@ package handlers import ( "context" "net" + "time" ) // NewTCPCheck returns a check that connects to a given tcp endpoint. func NewTCPCheck(address string) func(ctx context.Context) error { return func(_ context.Context) error { - conn, err := net.Dial("tcp", address) + conn, err := net.DialTimeout("tcp", address, 3*time.Second) if err != nil { return err }