ptarjan / node-cache

A simple in-memory cache for nodejs
BSD 2-Clause "Simplified" License
1.59k stars 214 forks source link

Updating the expire time on get based on flag #66

Closed schafer14 closed 8 years ago

schafer14 commented 8 years ago

Added a flag to the get function to specify if the expiry time should be updated when a get is done.

ptarjan commented 8 years ago

Get is not the place for a write operation. Why can't you use set to update it?

schafer14 commented 8 years ago

Yeah, that will work. I need to unbreak the tests too.

ptarjan commented 8 years ago

No, why can't you call put(key, value, newtime) instead of changing the library's api?

schafer14 commented 8 years ago

Yeah that's much simpler. Didn't think of that.