Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Apply fix from basho/riak_kv#314 for ttl test breakage.

  • Loading branch information...
commit 9e7e039efd3c89ef0719664349aa85e1a5d0576b 1 parent 90c2915
@seancribbs seancribbs authored
View
BIN  erl_src/riak_kv_test_backend.beam
Binary file not shown
View
9 erl_src/riak_kv_test_backend.erl
@@ -164,6 +164,7 @@ stop(#state{data_ref=DataRef,
get(Bucket, Key, State=#state{data_ref=DataRef,
index_ref=IndexRef,
used_memory=UsedMemory,
+ max_memory=MaxMemory,
ttl=TTL}) ->
case ets:lookup(DataRef, {Bucket, Key}) of
[] -> {error, not_found, State};
@@ -175,7 +176,13 @@ get(Bucket, Key, State=#state{data_ref=DataRef,
%% entries blindly using match_delete.
ets:delete(DataRef, {Bucket, Key}),
ets:match_delete(IndexRef, ?DELETE_PTN(Bucket, Key)),
- {error, not_found, State#state{used_memory=UsedMemory - object_size(Object)}};
+ case MaxMemory of
+ undefined ->
+ UsedMemory1 = UsedMemory;
+ _ ->
+ UsedMemory1 = UsedMemory - object_size(Object)
+ end,
+ {error, not_found, State#state{used_memory=UsedMemory1}};
false ->
{ok, Val, State}
end;
Please sign in to comment.
Something went wrong with that request. Please try again.