Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Use phash2() and the new Time API as a random seed
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbbell committed Aug 5, 2015
1 parent fc61e82 commit 15985ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rabbit_shovel_worker.erl
Expand Up @@ -54,7 +54,9 @@ handle_call(_Msg, _From, State) ->
{noreply, State}.

handle_cast(init, State = #state{config = Config}) ->
random:seed(now()),
random:seed(erlang:phash2([node()]),
time_compat:monotonic_time(),
time_compat:unique_integer()),
#shovel{sources = Sources, destinations = Destinations} = Config,
{InboundConn, InboundChan, InboundURI} =
make_conn_and_chan(Sources#endpoint.uris),
Expand Down

0 comments on commit 15985ed

Please sign in to comment.