mirror of
https://github.com/btdig/dhtcrawler2.git
synced 2025-01-31 18:41:37 +00:00
restore `top' cache
This commit is contained in:
parent
a82fa71cf4
commit
91731f7839
@ -84,8 +84,8 @@ handle_info(_, State) ->
|
|||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
% for debug purpose
|
% for debug purpose
|
||||||
query(top, State) ->
|
%query(top, State) ->
|
||||||
{State, do_update(top)};
|
% {State, do_update(top)};
|
||||||
|
|
||||||
% for debug purpose
|
% for debug purpose
|
||||||
query(stats, State) ->
|
query(stats, State) ->
|
||||||
@ -133,6 +133,7 @@ do_query(Type, #state{cache = Cache} = State) ->
|
|||||||
% update the time so that it will not be scheduled more time
|
% update the time so that it will not be scheduled more time
|
||||||
gb_trees:enter(Type, {now(), Ret}, Cache);
|
gb_trees:enter(Type, {now(), Ret}, Cache);
|
||||||
false ->
|
false ->
|
||||||
|
io:format("response cache to ~p~n", [Type]),
|
||||||
Cache
|
Cache
|
||||||
end,
|
end,
|
||||||
{State#state{cache = NewCache}, Ret}.
|
{State#state{cache = NewCache}, Ret}.
|
||||||
|
Loading…
Reference in New Issue
Block a user