msiemens/tinydb

Lru cache refresh question

hwchen opened this issue · 2 comments

Hello, I have a question about the Lru Cache:

https://github.com/msiemens/tinydb/blob/master/tinydb/utils.py#L36

Should the refresh() method only append a value only if it already existed and was removed? For example, in when refresh() is called in get(), I think it's possible that a wrong key will still result in that key being added to the lru.

Yep, that's a bug! The tests actually didn't cover that case. I've now added and pushed the corresponding tests. Thanks for reporting!

Glad I could help!

On Sun, Jan 3, 2016 at 6:17 PM, Markus Siemens notifications@github.com
wrote:

Yep, that's a bug! The tests actually didn't cover that case. I've now
added and pushed the corresponding tests. Thanks for reporting!


Reply to this email directly or view it on GitHub
#87 (comment).