File tree 3 files changed +10
-2
lines changed
3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## v2.0.4
2
+ * Reconnect when a redis command fails.
3
+
1
4
## v2.0.3
2
5
* Added ` topics ` to ` pubspec.yaml ` .
3
6
Original file line number Diff line number Diff line change @@ -131,7 +131,12 @@ class RedisCacheProvider extends CacheProvider<List<int>> {
131
131
try {
132
132
return await fn (ctx.client).timeout (_commandTimeLimit);
133
133
} on RedisCommandException catch (e) {
134
- throw AssertionError ('error from redis command: $e ' );
134
+ // We don't really know what happened, let's log shout it.
135
+ // It could be a sign that something really bad is happening to redis.
136
+ // Best shutdown the connection and try again.
137
+ _log.shout ('Error from redis command: $e ' );
138
+ await ctx.client.close (force: true );
139
+ throw IntermittentCacheException ('error from redis command: $e ' );
135
140
} on TimeoutException {
136
141
// If we had a timeout, doing the command we forcibly disconnect
137
142
// from the server, such that next retry will use a new connection.
Original file line number Diff line number Diff line change 1
1
name : neat_cache
2
- version : 2.0.3
2
+ version : 2.0.4
3
3
description : >-
4
4
A neat cache abstraction for wrapping in-memory or redis caches.
5
5
homepage : https://github.com/google/dart-neats/tree/master/neat_cache
You can’t perform that action at this time.
0 commit comments