diff options
author | Anders Svensson <[email protected]> | 2015-02-09 00:36:56 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2015-02-20 02:26:53 +0100 |
commit | e6d19a18b7c1057c2b4493f8db822c82bb0dbe0d (patch) | |
tree | 41d01dded073f8c7722b96166e7a8a9de11f3d0f /lib/diameter/src/base/diameter_service.erl | |
parent | 5f6399fb9f5d1552bb0050b18e1c9a9085d8b5db (diff) | |
download | otp-e6d19a18b7c1057c2b4493f8db822c82bb0dbe0d.tar.gz otp-e6d19a18b7c1057c2b4493f8db822c82bb0dbe0d.tar.bz2 otp-e6d19a18b7c1057c2b4493f8db822c82bb0dbe0d.zip |
Use new time api in implementation
In particular, deal with the deprecation of erlang:now/0 in OTP 18. Be
backwards compatible with older releases: the new api is only used when
available.
The test suites have not been modified.
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 96897c71eb..694d64336c 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -24,6 +24,9 @@ -module(diameter_service). -behaviour(gen_server). +-compile({no_auto_import, [now/0]}). +-import(diameter_lib, [now/0]). + %% towards diameter_service_sup -export([start_link/1]). @@ -1196,7 +1199,7 @@ connect_timer(Opts, Def0) -> %% continuous restarted in case of faulty config or other problems. tc(Time, Tc) -> choose(Tc > ?RESTART_TC - orelse timer:now_diff(now(), Time) > 1000*?RESTART_TC, + orelse diameter_lib:micro_diff(Time) > 1000*?RESTART_TC, Tc, ?RESTART_TC). |