kapouer / node-lfu-cache

Least Frequently Used cache with optional decay
MIT License
13 stars 2 forks source link

Cannot find an element to evict #1

Open facundoolano opened 7 years ago

facundoolano commented 7 years ago

Hi, I found that lfu.set starts throwing the following error when running some tests agains it. I'm using it like: const lfu = require('lfu-cache')(20, 60000);

Let me know if there are other details I can provide.

[Error: Cannot find an element to evict - please report issue,     
at LFU.evict (/Users/facundo/dev/mad/api-gateway/node_modules/lfu-cache/index.js:122:9),     
at LFU.set (/Users/facundo/dev/mad/api-gateway/node_modules/lfu-cache/index.js:85:8),     
at /Users/facundo/dev/mad/api-gateway/lib/application/index.js:44:17,     
at process._tickCallback (node.js:412:9)]
kapouer commented 7 years ago

Could provide a test case ? There is already some test doing stuff with decay, you just have to add one test and make a pull request for it.