Merge branch 'stable'
This commit is contained in:
commit
54dcb14fed
|
@ -1,6 +1,6 @@
|
||||||
PROJECT = rabbitmq_auth_backend_cache
|
PROJECT = rabbitmq_auth_backend_cache
|
||||||
|
|
||||||
DEPS = rabbit_common
|
DEPS = rabbit_common rabbit
|
||||||
TEST_DEPS += rabbit rabbitmq_ct_helpers rabbitmq_ct_client_helpers
|
TEST_DEPS += rabbit rabbitmq_ct_helpers rabbitmq_ct_client_helpers
|
||||||
|
|
||||||
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
|
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
|
||||||
|
|
|
@ -38,7 +38,7 @@ behaviour_info(_Other) ->
|
||||||
-endif.
|
-endif.
|
||||||
|
|
||||||
expiration(TTL) ->
|
expiration(TTL) ->
|
||||||
erlang:system_time(milli_seconds) + TTL.
|
time_compat:erlang_system_time(milli_seconds) + TTL.
|
||||||
|
|
||||||
expired(Exp) ->
|
expired(Exp) ->
|
||||||
erlang:system_time(milli_seconds) > Exp.
|
time_compat:erlang_system_time(milli_seconds) > Exp.
|
||||||
|
|
|
@ -78,7 +78,7 @@ handle_cast(_, State = #state{}) ->
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(gc, State = #state{}) ->
|
handle_info(gc, State = #state{}) ->
|
||||||
Now = erlang:system_time(milli_seconds),
|
Now = time_compat: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 = erlang:system_time(milli_seconds),
|
Now = time_compat: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].
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,9 @@ init_per_testcase0(_, Config) -> Config.
|
||||||
|
|
||||||
end_per_testcase(Test, Config) ->
|
end_per_testcase(Test, Config) ->
|
||||||
AuthCacheModule = ?config(auth_cache_module, Config),
|
AuthCacheModule = ?config(auth_cache_module, Config),
|
||||||
gen_server:stop(AuthCacheModule),
|
% gen_server:stop(AuthCacheModule),
|
||||||
|
Pid = whereis(AuthCacheModule),
|
||||||
|
exit(Pid, normal),
|
||||||
end_per_testcase0(Test, Config).
|
end_per_testcase0(Test, Config).
|
||||||
|
|
||||||
end_per_testcase0(get_expired, Config) ->
|
end_per_testcase0(get_expired, Config) ->
|
||||||
|
|
Loading…
Reference in New Issue