Skip to content

Commit eab693c

Browse files
authored
Merge pull request #1 from Shpaky/v1.0.1
fix - 'reset_handler/4' function of 'lru' module
2 parents 2f4fcfd + c06bf4c commit eab693c

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ max key size
224224

225225
###### external:
226226

227-
CLEAN:SYNC %% JSON: "{[{counter:[key]}]:UNIQ_REF}"
227+
CLEAN:SYNC %% JSON: "{{counter:[key]}:UNIQ_REF}"
228228
CLEAN:UNIQ_REF %% "OK"
229229

230230
#### put list keys with conters

include/lru.hrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
-define(MAX_KEY_SIZE,fun() -> application:get_env(lru,max_key_size,72) end).
1414

1515
%%
16-
%% following settings in progress develop
16+
%% this is setting in progress develop
1717
%%
1818
-define(SPAWN_OPT_LRU,[
1919
% {max_heap_size,0},

lru.app

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{application,lru,[
22
{description,"Least Recently Used Algorithm"},
3-
{vsn,"1.0.0"},
3+
{vsn,"1.0.1"},
44
{modules,[
55
lru_app,lru_sup,lru,
66
lru_protocol,lru_utils

lru.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[{lru,[
2-
{ets_dir,"priv"}, %% !!! must be atom string !!!!!
2+
{ets_dir,"priv"}, %% !!! must be string type !!!!!
33
{ets_sync_reset,true}, %% !!! must be atom type !!!!!
44
{ets_recovery,true}, %% !!! must be atom type !!!!!
55
{tcp,on}, %% !!! must be atom type !!!!!

priv/lru.rel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
{crypto,"4.8"},
1010
{public_key,"1.9"},
1111
{asn1,"5.0.14"},
12-
{lru, "1.0.0"}]
12+
{lru, "1.0.1"}]
1313
}.

priv/lru.tar.gz

-5 Bytes
Binary file not shown.

src/lru.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ reset_handler({_,KL},O,C,Q) ->
361361
end,
362362
ets:delete(?ETS_KEYS_STORE_TABLE_NAME,K),
363363
if
364-
OC == O ->
364+
OC == NO ->
365365
[compute_oldest_key((OC-1) div ?SERIE_SIZE,(C-1) div ?SERIE_SIZE),NQ-1];
366366
true ->
367367
[NO,NQ-1]
@@ -387,7 +387,7 @@ reset_handler(T,O,C,Q) ->
387387
end,
388388
ets:delete(?ETS_KEYS_STORE_TABLE_NAME,K),
389389
if
390-
OC == O ->
390+
OC == NO ->
391391
[compute_oldest_key((OC-1) div ?SERIE_SIZE,(C-1) div ?SERIE_SIZE),NQ-1];
392392
true ->
393393
[NO,NQ-1]

src/lru_protocol.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ common(info,{tcp,S,<<"CLEAN:SYNC",E/binary>>},[S,T]) when E =:= <<>> orelse E =:
130130
BK = pack_list_to_binary(KL,<<>>),
131131
BD = <<"{",BC/binary,":",BK/binary,"}">>,
132132
BR = list_to_binary(ref_to_list(R)),
133-
T:send(S,<<"{","[",BD/binary,"]",":",BR/binary,"}">>),
133+
T:send(S,<<"{",BD/binary,":",BR/binary,"}">>),
134134
{next_state,delete,[S,T,#{ref => BR, key => {C,KL}}],[{state_timeout,?TIMEOUT_STATE_DELETE,BR}]};
135135
_ ->
136136
T:send(S,<<"{","ERROR",":","UNKNOW_ERROR","}">>),

0 commit comments

Comments
 (0)