aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_watchdog.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2015-08-04 23:46:29 +0200
committerAnders Svensson <[email protected]>2015-08-05 10:17:19 +0200
commit96d63dca845e18f86488db9d8dfb33eb76ad0467 (patch)
tree5a7b1f6f5f1fd84ff21b6280c04fc8f9a3be5cd0 /lib/diameter/src/base/diameter_watchdog.erl
parent9c0f2f2ce3ed040b3963d5b00cad0276c276d590 (diff)
downloadotp-96d63dca845e18f86488db9d8dfb33eb76ad0467.tar.gz
otp-96d63dca845e18f86488db9d8dfb33eb76ad0467.tar.bz2
otp-96d63dca845e18f86488db9d8dfb33eb76ad0467.zip
Simplify time manipulation
By doing away with more wrapping that the parent commit started to remove.
Diffstat (limited to 'lib/diameter/src/base/diameter_watchdog.erl')
-rw-r--r--lib/diameter/src/base/diameter_watchdog.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl
index 66781d7b06..009a766e43 100644
--- a/lib/diameter/src/base/diameter_watchdog.erl
+++ b/lib/diameter/src/base/diameter_watchdog.erl
@@ -124,8 +124,7 @@ i({Ack, T, Pid, {RecvData,
= Svc}}) ->
monitor(process, Pid),
wait(Ack, Pid),
- {_, Seed} = diameter_lib:seed(),
- random:seed(Seed),
+ random:seed(now()),
putr(restart, {T, Opts, Svc, SvcOpts}), %% save seeing it in trace
putr(dwr, dwr(Caps)), %%
{_,_} = Mask = proplists:get_value(sequence, SvcOpts),
@@ -453,7 +452,7 @@ transition({timeout, TRef, tw}, #watchdog{tref = TRef} = S) ->
%% Message has arrived since the timer was started: subtract time
%% already elapsed from new timer.
transition({timeout, _, tw}, #watchdog{tref = T0} = S) ->
- set_watchdog(diameter_lib:micro_diff(T0) div 1000, S);
+ set_watchdog(timer:now_diff(now(), T0) div 1000, S);
%% State query.
transition({state, Pid}, #watchdog{status = S}) ->
@@ -535,7 +534,7 @@ set_watchdog(#watchdog{tref = undefined} = S) ->
%% Timer already set: start at new one only at expiry.
set_watchdog(#watchdog{} = S) ->
- S#watchdog{tref = diameter_lib:now()};
+ S#watchdog{tref = now()};
set_watchdog(stop = No) ->
No.