fix: unify the health check interval

This commit is contained in:
Shawn 2022-08-15 15:22:13 +08:00
parent 00966df18f
commit 665ef4142d
1 changed files with 1 additions and 2 deletions

View File

@ -56,7 +56,6 @@
-record(data, {id, manager_id, group, mod, callback_mode, config, opts, status, state, error}). -record(data, {id, manager_id, group, mod, callback_mode, config, opts, status, state, error}).
-type data() :: #data{}. -type data() :: #data{}.
-define(SHORT_HEALTHCHECK_INTERVAL, 1000).
-define(ETS_TABLE, ?MODULE). -define(ETS_TABLE, ?MODULE).
-define(WAIT_FOR_RESOURCE_DELAY, 100). -define(WAIT_FOR_RESOURCE_DELAY, 100).
-define(T_OPERATION, 5000). -define(T_OPERATION, 5000).
@ -484,7 +483,7 @@ handle_connecting_health_check(Data) ->
(connected, UpdatedData) -> (connected, UpdatedData) ->
{next_state, connected, UpdatedData}; {next_state, connected, UpdatedData};
(connecting, UpdatedData) -> (connecting, UpdatedData) ->
Actions = [{state_timeout, ?SHORT_HEALTHCHECK_INTERVAL, health_check}], Actions = [{state_timeout, ?HEALTHCHECK_INTERVAL, health_check}],
{keep_state, UpdatedData, Actions}; {keep_state, UpdatedData, Actions};
(disconnected, UpdatedData) -> (disconnected, UpdatedData) ->
{next_state, disconnected, UpdatedData} {next_state, disconnected, UpdatedData}