You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2019/02/21 03:52:50 UTC

[couchdb-ets-lru] 20/30: Allow an ets_lru to be completely disabled

This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch time-unit-parameterization
in repository https://gitbox.apache.org/repos/asf/couchdb-ets-lru.git

commit 80cc7e1a21e35a643c7b9f26b9939ac6af0cc5ce
Author: Joan Touzet <jo...@atypical.net>
AuthorDate: Fri Jun 2 03:09:13 2017 -0400

    Allow an ets_lru to be completely disabled
---
 src/ets_lru.erl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ets_lru.erl b/src/ets_lru.erl
index 0c94e17..7a366ba 100644
--- a/src/ets_lru.erl
+++ b/src/ets_lru.erl
@@ -326,11 +326,11 @@ next_timeout(St) ->
 
 set_options(St, []) ->
     St;
-set_options(St, [{max_objects, N} | Rest]) when is_integer(N), N > 0 ->
+set_options(St, [{max_objects, N} | Rest]) when is_integer(N), N >= 0 ->
     set_options(St#st{max_objs=N}, Rest);
-set_options(St, [{max_size, N} | Rest]) when is_integer(N), N > 0 ->
+set_options(St, [{max_size, N} | Rest]) when is_integer(N), N >= 0 ->
     set_options(St#st{max_size=N}, Rest);
-set_options(St, [{max_lifetime, N} | Rest]) when is_integer(N), N > 0 ->
+set_options(St, [{max_lifetime, N} | Rest]) when is_integer(N), N >= 0 ->
     set_options(St#st{max_lifetime=N}, Rest);
 set_options(_, [Opt | _]) ->
     throw({invalid_option, Opt}).