Skip to content

Commit

Permalink
Merge pull request #1 from Shpaky/v1.0.1
Browse files Browse the repository at this point in the history
fix - 'reset_handler/4' function of 'lru' module
  • Loading branch information
Shpaky authored Jan 8, 2021
2 parents 2f4fcfd + c06bf4c commit eab693c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ max key size

###### external:

CLEAN:SYNC %% JSON: "{[{counter:[key]}]:UNIQ_REF}"
CLEAN:SYNC %% JSON: "{{counter:[key]}:UNIQ_REF}"
CLEAN:UNIQ_REF %% "OK"

#### put list keys with conters
Expand Down
2 changes: 1 addition & 1 deletion include/lru.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
-define(MAX_KEY_SIZE,fun() -> application:get_env(lru,max_key_size,72) end).

%%
%% following settings in progress develop
%% this is setting in progress develop
%%
-define(SPAWN_OPT_LRU,[
% {max_heap_size,0},
Expand Down
2 changes: 1 addition & 1 deletion lru.app
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application,lru,[
{description,"Least Recently Used Algorithm"},
{vsn,"1.0.0"},
{vsn,"1.0.1"},
{modules,[
lru_app,lru_sup,lru,
lru_protocol,lru_utils
Expand Down
2 changes: 1 addition & 1 deletion lru.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[{lru,[
{ets_dir,"priv"}, %% !!! must be atom string !!!!!
{ets_dir,"priv"}, %% !!! must be string type !!!!!
{ets_sync_reset,true}, %% !!! must be atom type !!!!!
{ets_recovery,true}, %% !!! must be atom type !!!!!
{tcp,on}, %% !!! must be atom type !!!!!
Expand Down
2 changes: 1 addition & 1 deletion priv/lru.rel
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
{crypto,"4.8"},
{public_key,"1.9"},
{asn1,"5.0.14"},
{lru, "1.0.0"}]
{lru, "1.0.1"}]
}.
Binary file modified priv/lru.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions src/lru.erl
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ reset_handler({_,KL},O,C,Q) ->
end,
ets:delete(?ETS_KEYS_STORE_TABLE_NAME,K),
if
OC == O ->
OC == NO ->
[compute_oldest_key((OC-1) div ?SERIE_SIZE,(C-1) div ?SERIE_SIZE),NQ-1];
true ->
[NO,NQ-1]
Expand All @@ -387,7 +387,7 @@ reset_handler(T,O,C,Q) ->
end,
ets:delete(?ETS_KEYS_STORE_TABLE_NAME,K),
if
OC == O ->
OC == NO ->
[compute_oldest_key((OC-1) div ?SERIE_SIZE,(C-1) div ?SERIE_SIZE),NQ-1];
true ->
[NO,NQ-1]
Expand Down
2 changes: 1 addition & 1 deletion src/lru_protocol.erl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ common(info,{tcp,S,<<"CLEAN:SYNC",E/binary>>},[S,T]) when E =:= <<>> orelse E =:
BK = pack_list_to_binary(KL,<<>>),
BD = <<"{",BC/binary,":",BK/binary,"}">>,
BR = list_to_binary(ref_to_list(R)),
T:send(S,<<"{","[",BD/binary,"]",":",BR/binary,"}">>),
T:send(S,<<"{",BD/binary,":",BR/binary,"}">>),
{next_state,delete,[S,T,#{ref => BR, key => {C,KL}}],[{state_timeout,?TIMEOUT_STATE_DELETE,BR}]};
_ ->
T:send(S,<<"{","ERROR",":","UNKNOW_ERROR","}">>),
Expand Down

0 comments on commit eab693c

Please sign in to comment.