fixeria submitted this change.
pfcp_peer: replace deprecated erlang:timestamp/0 with os:system_time/1
erlang:timestamp/0 is deprecated since OTP 18. os:system_time(second)
is the modern replacement and yields the result directly in seconds,
removing the need to reassemble the {MegaSec, Sec, _} tuple.
Change-Id: I4ad886a2222f0cee8a668b42efe8bfac800a55ac
---
M src/pfcp_peer.erl
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/pfcp_peer.erl b/src/pfcp_peer.erl
index a4cc2d5..e1b3aa1 100644
--- a/src/pfcp_peer.erl
+++ b/src/pfcp_peer.erl
@@ -477,11 +477,10 @@
-spec get_recovery_timestamp() -> pos_integer().
get_recovery_timestamp() ->
- {NowMS, NowS, _NowUS} = erlang:timestamp(),
- %% erlang:timestamp() returns time relative to the UNIX epoch (1970),
+ %% os:system_time/1 returns time relative to the UNIX epoch (1970),
%% but for PFCP we need time relative to the NTP era 0 (1900).
%% 2208988800 is the diff between 1900 and 1970.
- NowMS * 1_000_000 + NowS + 2208988800.
+ os:system_time(second) + 2208988800.
-spec get_f_seid(pfcp_seid(), peer_state()) -> pfcp_f_seid().
To view, visit change 42292. To unsubscribe, or for help writing mail filters, visit settings.