vivekn / redis-simple-cache

Simple redis based cache for storing results of python function calls, json encoded strings or html.
Other
122 stars 69 forks source link

Allow persistent storage. #27

Closed deybhayden closed 10 years ago

deybhayden commented 10 years ago

This comes from issue #26. I made a simple change to check if expire was None or less than zero, and if so call set() instead of setx().

szaydel commented 10 years ago

This looks reasonable to me, I would only change if expire is None or expire < 0: to if not expire or expire < 0: but this is a semantic thing. However, since this is really a caching library, why would you be setting anything persistently? Are you sure the application is correct here?

vivekn commented 10 years ago

I think the API should be more consistent, expire=None should not have two different meanings in two different places. Let's make only expire <= 0 mean persistent.