|
|
@@ -270,12 +270,7 @@ client_options(Config = #{url := ServerURL, ssl := SSL}) ->
|
|
|
check_status(ConnectorState) ->
|
|
|
try start_client(ConnectorState) of
|
|
|
{ok, Client} ->
|
|
|
- try hstreamdb_client:echo(Client) of
|
|
|
- ok -> ok;
|
|
|
- {error, _} = ErrorEcho -> ErrorEcho
|
|
|
- after
|
|
|
- _ = hstreamdb:stop_client(Client)
|
|
|
- end;
|
|
|
+ check_status_with_client(Client);
|
|
|
{error, _} = StartClientError ->
|
|
|
StartClientError
|
|
|
catch
|
|
|
@@ -283,6 +278,14 @@ check_status(ConnectorState) ->
|
|
|
{error, {ErrorType, Reason}}
|
|
|
end.
|
|
|
|
|
|
+check_status_with_client(Client) ->
|
|
|
+ try hstreamdb_client:echo(Client) of
|
|
|
+ ok -> ok;
|
|
|
+ {error, _} = ErrorEcho -> ErrorEcho
|
|
|
+ after
|
|
|
+ _ = hstreamdb:stop_client(Client)
|
|
|
+ end.
|
|
|
+
|
|
|
start_client(Opts) ->
|
|
|
ClientOptions = maps:get(client_options, Opts),
|
|
|
case hstreamdb:start_client(ClientOptions) of
|