Compatibility with master

This commit is contained in:
Daniil Fedotov 2016-06-02 11:47:26 +01:00
parent 28d22cdca4
commit 0950ff943d
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ behaviour_info(_Other) ->
-endif. -endif.
expiration(TTL) -> expiration(TTL) ->
time_compat:erlang_system_time(milli_seconds) + TTL. erlang:system_time(milli_seconds) + TTL.
expired(Exp) -> expired(Exp) ->
time_compat:erlang_system_time(milli_seconds) > Exp. erlang:system_time(milli_seconds) > Exp.

View File

@ -78,7 +78,7 @@ handle_cast(_, State = #state{}) ->
{noreply, State}. {noreply, State}.
handle_info(gc, State = #state{}) -> handle_info(gc, State = #state{}) ->
Now = time_compat:erlang_system_time(milli_seconds), Now = erlang:system_time(milli_seconds),
MatchSpec = [{{'$1', '$2'}, [{'<', '$1', {const, Now}}], ['$2']}], MatchSpec = [{{'$1', '$2'}, [{'<', '$1', {const, Now}}], ['$2']}],
Expired = ets:select(?SEGMENT_TABLE, MatchSpec), Expired = ets:select(?SEGMENT_TABLE, MatchSpec),
[ets:delete(Table) || Table <- Expired], [ets:delete(Table) || Table <- Expired],
@ -110,7 +110,7 @@ do_add_segment(Segment) ->
end. end.
get_segment_tables() -> get_segment_tables() ->
Now = time_compat:erlang_system_time(milli_seconds), Now = erlang:system_time(milli_seconds),
MatchSpec = [{{'$1', '$2'}, [{'>', '$1', {const, Now}}], ['$_']}], MatchSpec = [{{'$1', '$2'}, [{'>', '$1', {const, Now}}], ['$_']}],
[V || {K, V} <- ets:select(?SEGMENT_TABLE, MatchSpec), K =/= segment_size]. [V || {K, V} <- ets:select(?SEGMENT_TABLE, MatchSpec), K =/= segment_size].