Skip to content

Commit

Permalink
Merge pull request #15 from emqx/check_interval
Browse files Browse the repository at this point in the history
fix(mc_monitor): mc_monitor:check/2 run too frequently
  • Loading branch information
terry-xiaoyu authored Oct 19, 2021
2 parents f774a5d + cddfb40 commit 2676d5e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/mongoc/mc_monitor.erl
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ loop(State = #state{type = Type, host = Host, port = Port, topology = Topology,
State#state{timer = undefined, counter = Counter + 1}.

%% @private
maybe_recheck(unknown, Topology, Server, _, _, _) ->
maybe_recheck(unknown, Topology, Server, _, _HB_MS, MinHB_MS) ->
gen_server:cast(Topology, {server_to_unknown, Server}),
next_loop(self(), 1);
next_loop(self(), MinHB_MS);
maybe_recheck(_, Topology, Server, ConnectArgs, HB_MS, MinHB_MS) ->
timer:sleep(MinHB_MS),
try check(ConnectArgs, Server) of
Expand Down
2 changes: 1 addition & 1 deletion src/mongodb.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%% ex: ts=4 sw=4 noexpandtab syntax=erlang
{application, mongodb, [
{description, "Client interface to MongoDB, also known as the driver. See www.mongodb.org"},
{vsn, "3.0.8"},
{vsn, "3.0.9"},
{registered, []},
{applications, [kernel, stdlib, bson, crypto, poolboy, pbkdf2]},
{mod, {mongo_app, []}}
Expand Down
12 changes: 9 additions & 3 deletions src/mongodb.appup.src
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
%% -*- mode: erlang -*-
{"3.0.8",
[{<<"3.0.[0-7]">>, [
{"3.0.9",
[{"3.0.8", [
{load_module, mc_monitor, brutal_purge, soft_purge, []}
]},
{<<"3.0.[0-7]">>, [
{restart_application, mongodb}
]},
{<<".*">>, []}
],
[{<<"3.0.[0-7]">>, [
[{"3.0.8", [
{load_module, mc_monitor, brutal_purge, soft_purge, []}
]},
{<<"3.0.[0-7]">>, [
{restart_application, mongodb}
]},
{<<".*">>, []}
Expand Down

0 comments on commit 2676d5e

Please sign in to comment.