Closed kpdecker closed 10 years ago
Dropping toCache()
and getTtl()
as they are no longer used. The generateFunc
signature is changing to function(err, value, ttl)
where ttl
is null
or undefined
for default policy and 0
means not to cache.
Will there be a way to feature detect the change in API? Fruit loops for example is dependent on whatever version of catbox that is passed into it, which is mostly likely dependent on the current hapi environment.
On Sat, Mar 8, 2014 at 5:31 PM, Eran Hammer notifications@github.comwrote:
Closed #56 https://github.com/spumko/catbox/issues/56 via 3214f68https://github.com/spumko/catbox/commit/3214f68ce3a910cafae754d808711a4d98cae6df .
— Reply to this email directly or view it on GitHubhttps://github.com/spumko/catbox/issues/56 .
This is now causing our entire app to hang due to data not being saved properly and having no method of knowing which API we are dealing with. This is no migration strategy here?
You need to manage the versions externally to catbox. If you know you are passing version 1 catbox to a module expecting version 2, you can wrap the getOrGenerate method to simulate the old API.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
When using
toCache
, the return forPolicy.getOrGenerate
will be either the object containing thetoCache
method for the case of freshly initialized data or the return oftoCache
for cached data.This was a bit confusing as I expected the data sent to the callback to be the same in either situation.