diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-06 12:58:05 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-07 09:34:27 +0300 |
commit | eeffe3ea0a7d6f019b1c4d8de037325e6ffc137f (patch) | |
tree | e3b5f9d50ebc85cc2c039cdf98e218ad9d736fd1 | |
parent | 154617c26466a8e14ed14beb149a0e80f752878b (diff) |
client: Move `FailOnNonTempDialError` logic into internal package
Move the `FailOnNonTempDialError` logic into our internal client
package. Like this we can reuse the functionality internally without
having to rely on our public interface, which allows us to iterate on
its internal implementation without breaking the public API.
-rw-r--r-- | client/dial.go | 5 | ||||
-rw-r--r-- | internal/grpc/client/dial.go | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/client/dial.go b/client/dial.go index e552e6f6a..3bc103b4c 100644 --- a/client/dial.go +++ b/client/dial.go @@ -46,10 +46,7 @@ func DialSidechannel(ctx context.Context, rawAddress string, sr *SidechannelRegi // FailOnNonTempDialError helps to identify if remote listener is ready to accept new connections. func FailOnNonTempDialError() []grpc.DialOption { - return []grpc.DialOption{ - grpc.WithBlock(), - grpc.FailOnNonTempDialError(true), - } + return client.FailOnNonTempDialError() } // HealthCheckDialer uses provided dialer as an actual dialer, but issues a health check request to the remote diff --git a/internal/grpc/client/dial.go b/internal/grpc/client/dial.go index f0a26576a..a4f076c3a 100644 --- a/internal/grpc/client/dial.go +++ b/internal/grpc/client/dial.go @@ -250,6 +250,14 @@ func defaultServiceConfig() string { return string(configJSON) } +// FailOnNonTempDialError helps to identify if remote listener is ready to accept new connections. +func FailOnNonTempDialError() []grpc.DialOption { + return []grpc.DialOption{ + grpc.WithBlock(), + grpc.FailOnNonTempDialError(true), + } +} + // HealthCheckDialer uses provided dialer as an actual dialer, but issues a health check request to the remote // to verify the connection was set properly and could be used with no issues. func HealthCheckDialer(base Dialer) Dialer { |