Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modify node-existence function

  • Loading branch information...
commit cd1356dbdb1b48d67755211acc9de71439083d91 1 parent df0cb22
@yosukehara yosukehara authored
Showing with 8 additions and 4 deletions.
  1. +7 −3 src/leo_misc.erl
  2. +1 −1  test/leo_misc_tests.erl
View
10 src/leo_misc.erl
@@ -27,7 +27,8 @@
-author('Yosuke Hara').
--export([node_existence/1, get_value/2, get_value/3,
+-export([node_existence/1, node_existence/2,
+ get_value/2, get_value/3,
binary_tokens/2,
init_env/0, get_env/2, set_env/3
]).
@@ -38,9 +39,12 @@
%% @doc check a node existence.
%%
-spec(node_existence(atom()) ->
- boolean).
+ boolean()).
node_existence(Node) ->
- (net_adm:ping(Node) == pong).
+ node_existence(Node, 5000).
+
+node_existence(Node, Timeout) ->
+ (Node == rpc:call(Node, erlang, node, [], Timeout)).
%% @doc Retrieve a value from prop-lists
View
2  test/leo_misc_tests.erl
@@ -48,7 +48,7 @@ node_existence_() ->
net_kernel:stop(),
%% case-2
- false = leo_misc:node_existence(Node),
+ false = leo_misc:node_existence(Node, 3000),
ok.
get_value_() ->
Please sign in to comment.
Something went wrong with that request. Please try again.