diff --git a/.travis.yml b/.travis.yml index 1ff7433..5e3e9d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: erlang otp_release: + - 18.0 + - 17.5 - R16B - R15B02 - R15B01 diff --git a/src/epna_pool.erl b/src/epna_pool.erl index c05274d..1903e7f 100644 --- a/src/epna_pool.erl +++ b/src/epna_pool.erl @@ -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, []), + M*1000 + S + end. -spec make_registered_name(episcina:name()) -> term(). make_registered_name(Name) ->