Open mkeeler opened 6 years ago
@mkeeler you are right this is an edge case. However the code is not wrong when it denies creation of a size 1 2Q cache. A size 1 2Q cache makes no sense.
But yes the code should give proper error message instead of the current confusing one. So here is a small change I have made via PR #60
This seems to be due to calculating the frequent and recent LRU sizes and being truncated to 0. So when those get created the following error is returned:
"Must provide a positive size"
Obviously this is really edge casey as who would want a cache of size 1 (except I did when implementing some unit tests for Consul).