-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Using version 4.1.1 ,if the redis server isn't running or can't be connected to, the call to _redisDatabase.KeyExists() in RegisterParentDependencyDefinition() throws an exception.
My config is as follows:
It looks like the method: Get(string cacheKey, DateTime absoluteExpiryDate, Func getData, string parentKey = null, CacheDependencyAction actionForDependency = CacheDependencyAction.ClearDependentItems) handles the cache not being available when checking for the item, it's the code that tries to update the dependencies that doesn't.
After playing with this some more, I think there are two situations to consider:
- redis is not available when the application starts (or is recycled)
- redis is temporarily unavailable while the application is running
Event 2 is more likely to occur and I don't want it to make my app throw an exception. When reading, it should treat it as if it's not cached. An error when writing is trickier - perhaps only this web app can't connect, and others are fine? What if this is a dependency clear - other apps may still be able to get old data from redis.
Issue raised by @pdonovan on Bitbucket 2016-04-19 and migrated to Github