Merge pull request #11385 from paulozulato/fix-start-option-greptimedb

fix(greptimedb): add sync_start to avoid false negative healthy check
This commit is contained in:
Paulo Zulato 2023-08-03 14:29:47 -03:00 committed by GitHub
commit 5bc9fd7325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{application, emqx_bridge_greptimedb, [ {application, emqx_bridge_greptimedb, [
{description, "EMQX GreptimeDB Bridge"}, {description, "EMQX GreptimeDB Bridge"},
{vsn, "0.1.0"}, {vsn, "0.1.1"},
{registered, []}, {registered, []},
{applications, [ {applications, [
kernel, kernel,

View File

@ -53,6 +53,8 @@
-define(AUTO_RECONNECT_S, 1). -define(AUTO_RECONNECT_S, 1).
-define(CONNECT_TIMEOUT, 5_000).
%% ------------------------------------------------------------------------------------------------- %% -------------------------------------------------------------------------------------------------
%% resource callback %% resource callback
callback_mode() -> always_sync. callback_mode() -> always_sync.
@ -251,6 +253,12 @@ do_start_client(
{error, Reason} {error, Reason}
end. end.
grpc_config() ->
#{
sync_start => true,
connect_timeout => ?CONNECT_TIMEOUT
}.
client_config( client_config(
InstId, InstId,
Config = #{ Config = #{
@ -264,6 +272,7 @@ client_config(
{pool, InstId}, {pool, InstId},
{pool_type, random}, {pool_type, random},
{auto_reconnect, ?AUTO_RECONNECT_S}, {auto_reconnect, ?AUTO_RECONNECT_S},
{gprc_options, grpc_config()},
{timeunit, maps:get(precision, Config, ms)} {timeunit, maps:get(precision, Config, ms)}
] ++ protocol_config(Config). ] ++ protocol_config(Config).