diff --git a/README.md b/README.md index 069993f..9047195 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/include/lru.hrl b/include/lru.hrl index c2a6b66..17699e6 100644 --- a/include/lru.hrl +++ b/include/lru.hrl @@ -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}, diff --git a/lru.app b/lru.app index 3e7fcb2..bfb69cb 100644 --- a/lru.app +++ b/lru.app @@ -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 diff --git a/lru.config b/lru.config index a556432..3115d64 100644 --- a/lru.config +++ b/lru.config @@ -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 !!!!! diff --git a/priv/lru.rel b/priv/lru.rel index c8a9f1d..611cfb6 100644 --- a/priv/lru.rel +++ b/priv/lru.rel @@ -9,5 +9,5 @@ {crypto,"4.8"}, {public_key,"1.9"}, {asn1,"5.0.14"}, - {lru, "1.0.0"}] + {lru, "1.0.1"}] }. diff --git a/priv/lru.tar.gz b/priv/lru.tar.gz index cfd2451..d291e53 100644 Binary files a/priv/lru.tar.gz and b/priv/lru.tar.gz differ diff --git a/src/lru.erl b/src/lru.erl index a768c8f..6788a39 100644 --- a/src/lru.erl +++ b/src/lru.erl @@ -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] @@ -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] diff --git a/src/lru_protocol.erl b/src/lru_protocol.erl index 2024fde..da616b6 100644 --- a/src/lru_protocol.erl +++ b/src/lru_protocol.erl @@ -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","}">>),