-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use a compatible record-to-type declaration - adapt to the new time API while remaining backwards compatible.
- Loading branch information
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
language: erlang | ||
otp_release: | ||
- 18.0 | ||
- 17.5 | ||
- R16B | ||
- R15B02 | ||
- R15B01 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
%%% Types | ||
%%%=================================================================== | ||
|
||
-type state() :: record(state). | ||
-type state() :: #state{}. | ||
|
||
%%%=================================================================== | ||
%%% API | ||
|
@@ -284,8 +284,17 @@ cleanup_connection(C, State = #state{working=Working}) -> | |
%% Return the current time in seconds, used for timeouts. | ||
-spec now_secs() -> non_neg_integer(). | ||
now_secs() -> | ||
{M,S,_M} = erlang:now(), | ||
M*1000 + S. | ||
try | ||
%% use apply/3 because otherwise cover compilation | ||
%% fails on < 18.0 | ||
apply(erlang, monotonic_time, [seconds]) | ||
catch | ||
error:undef -> | ||
%% use apply/3 because otherwise the compiler | ||
%% warns in 18.0+ | ||
{M,S,_M} = apply(erlang, now, []), | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ferd
Author
Contributor
|
||
M*1000 + S | ||
end. | ||
|
||
-spec make_registered_name(episcina:name()) -> term(). | ||
make_registered_name(Name) -> | ||
|
Would
os:timestamp/1
be enough here? I see that onlyMegaSec
andSec
are used here.