|
@@ -10,6 +10,8 @@
|
|
|
-behaviour(gen_server).
|
|
|
-define(SERVER, ?MODULE).
|
|
|
|
|
|
+-include("pooler.hrl").
|
|
|
+
|
|
|
%% ------------------------------------------------------------------
|
|
|
%% API Function Exports
|
|
|
%% ------------------------------------------------------------------
|
|
@@ -91,7 +93,7 @@ init({Type, StartFun}) ->
|
|
|
handle_call(get_id, _From, State) ->
|
|
|
{reply, {State#state.type, State#state.id}, State};
|
|
|
handle_call({do_work, T}, _From, State) ->
|
|
|
- Sleep = random:uniform(T),
|
|
|
+ Sleep = ?RANDOM_UNIFORM(T),
|
|
|
timer:sleep(Sleep),
|
|
|
{reply, {ok, Sleep}, State};
|
|
|
handle_call(ping, _From, #state{ping_count = C } = State) ->
|