fix: enlarge the timeout when check alive of resources
This commit is contained in:
parent
60c8db5905
commit
e4a3dd9ee8
|
@ -95,6 +95,8 @@
|
||||||
end
|
end
|
||||||
end()).
|
end()).
|
||||||
|
|
||||||
|
-define(GET_RES_ALIVE_TIMEOUT, 60000).
|
||||||
|
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% Load resource/action providers from all available applications
|
%% Load resource/action providers from all available applications
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
|
@ -405,7 +407,7 @@ is_resource_alive(Nodes, ResId, _Opts = #{fetch := true}) ->
|
||||||
{ok, #resource_type{on_status = {Mod, OnStatus}}}
|
{ok, #resource_type{on_status = {Mod, OnStatus}}}
|
||||||
= emqx_rule_registry:find_resource_type(ResType),
|
= emqx_rule_registry:find_resource_type(ResType),
|
||||||
case rpc:multicall(Nodes,
|
case rpc:multicall(Nodes,
|
||||||
?MODULE, fetch_resource_status, [Mod, OnStatus, ResId], 5000) of
|
?MODULE, fetch_resource_status, [Mod, OnStatus, ResId], ?GET_RES_ALIVE_TIMEOUT) of
|
||||||
{ResL, []} ->
|
{ResL, []} ->
|
||||||
is_resource_alive_(ResL);
|
is_resource_alive_(ResL);
|
||||||
{_, _Error} ->
|
{_, _Error} ->
|
||||||
|
@ -420,7 +422,7 @@ is_resource_alive(Nodes, ResId, _Opts = #{fetch := true}) ->
|
||||||
end;
|
end;
|
||||||
is_resource_alive(Nodes, ResId, _Opts = #{fetch := false}) ->
|
is_resource_alive(Nodes, ResId, _Opts = #{fetch := false}) ->
|
||||||
try
|
try
|
||||||
case rpc:multicall(Nodes, ?MODULE, get_resource_status, [ResId], 5000) of
|
case rpc:multicall(Nodes, ?MODULE, get_resource_status, [ResId], ?GET_RES_ALIVE_TIMEOUT) of
|
||||||
{ResL, []} ->
|
{ResL, []} ->
|
||||||
is_resource_alive_(ResL);
|
is_resource_alive_(ResL);
|
||||||
{_, _Errors} ->
|
{_, _Errors} ->
|
||||||
|
|
Loading…
Reference in New Issue