rfink / sequelize-redis-cache

Small fluent interface for caching sequelize database query results in redis more easily
MIT License
175 stars 47 forks source link

put cacheHit to false on fetchFromDatabase. #19

Closed roccomuso closed 8 years ago

roccomuso commented 8 years ago

Perhaps I could be wrong, but looking at the code, If using the same instance of a cacher obj for multiple query, the cacheHit var is not put again to false.

Shouldn't we expect a self.cacheHit = false; before L64 https://github.com/rfink/sequelize-redis-cache/blob/master/lib/index.js#L64 ?

rfink commented 8 years ago

I believe you are correct, if someone were to re-use a cache instance, this could be a problem. I'll work on a fix. Thanks!

rfink commented 8 years ago

This is addressed in 1.2.1. Thanks!