Merge pull request #10324 from kjellwinblad/kjell/fix/EMQX-9374
fix: check Clickhouse connection after creation
This commit is contained in:
commit
601564fa0a
|
@ -0,0 +1 @@
|
||||||
|
Previously, when attempting to reconnect to a misconfigured Clickhouse bridge through the dashboard, users would not receive an error message. This issue is now resolved, and error messages will now be displayed
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -270,8 +270,15 @@ connect(Options) ->
|
||||||
{pool_size, PoolSize}
|
{pool_size, PoolSize}
|
||||||
],
|
],
|
||||||
case clickhouse:start_link(FixedOptions) of
|
case clickhouse:start_link(FixedOptions) of
|
||||||
{ok, _Conn} = Ok ->
|
{ok, Connection} ->
|
||||||
Ok;
|
%% Check if we can connect and send a query
|
||||||
|
case clickhouse:detailed_status(Connection) of
|
||||||
|
ok ->
|
||||||
|
{ok, Connection};
|
||||||
|
Error ->
|
||||||
|
ok = clickhouse:stop(Connection),
|
||||||
|
Error
|
||||||
|
end;
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{error, Reason}
|
{error, Reason}
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue