diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2018-05-29 15:44:09 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2018-05-29 15:45:10 +0300 |
| commit | a604fa6668fc5bcb2fbc67fdf3cd6920741a9b87 (patch) | |
| tree | e1ca76e28f0caea1229bcee1d7593a1079c4d6ac /src | |
| parent | 2df7b4cfad562dedaefa4bca908b04aef013e7c2 (diff) | |
| download | rabbitmq-server-git-a604fa6668fc5bcb2fbc67fdf3cd6920741a9b87.tar.gz | |
rabbit_nodes:await_running_count_with_retries/2: correct type spec and base clause return value
[#156729133]
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_nodes.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl index daee4259e0..d3ec06b05a 100644 --- a/src/rabbit_nodes.erl +++ b/src/rabbit_nodes.erl @@ -42,8 +42,6 @@ -spec all_running() -> [node()]. -spec running_count() -> integer(). --spec await_running_count(integer(), integer()) -> 'ok,' | {'error', atom()}. - %%---------------------------------------------------------------------------- name_type() -> @@ -94,11 +92,13 @@ all_running() -> rabbit_mnesia:cluster_nodes(running). running_count() -> length(all_running()). +-spec await_running_count(integer(), integer()) -> 'ok' | {'error', atom()}. + await_running_count(TargetCount, Timeout) -> Retries = floor(Timeout/?SAMPLING_INTERVAL), await_running_count_with_retries(TargetCount, Retries). -await_running_count_with_retries(1, _Retries) -> true; +await_running_count_with_retries(1, _Retries) -> ok; await_running_count_with_retries(_TargetCount, Retries) when Retries =:= 0 -> {error, timeout}; await_running_count_with_retries(TargetCount, Retries) -> |
