We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本情况
CSRedis:3.6.6
Redis版本:4.0.10
重现步骤
故障表现
原因
async public Task<bool> SetAsync(string key, object value, int expireSeconds = -1, RedisExistence? exists = null) { object redisValule = this.SerializeRedisValueInternal(value); if (expireSeconds <= 0 && exists == null) return await ExecuteScalarAsync(key, (c, k) => c.Value.SetAsync(k, redisValule)) == "OK"; if (expireSeconds <= 0 && exists != null) return await ExecuteScalarAsync(key, (c, k) => c.Value.SetAsync(k, redisValule, null, exists)) == "OK"; if (expireSeconds > 0 && exists == null) return await ExecuteScalarAsync(key, (c, k) => c.Value.SetAsync(k, redisValule, expireSeconds, null)) == "OK"; if (expireSeconds > 0 && exists != null) return await ExecuteScalarAsync(key, (c, k) => c.Value.SetAsync(k, redisValule, expireSeconds, exists)) == "OK"; return false; } async public Task<bool> SetAsync(string key, object value, TimeSpan expire, RedisExistence? exists = null) { object redisValule = this.SerializeRedisValueInternal(value); if (expire <= TimeSpan.Zero && exists == null) return await ExecuteScalar(key, (c, k) => c.Value.SetAsync(k, redisValule)) == "OK"; if (expire <= TimeSpan.Zero && exists != null) return await ExecuteScalar(key, (c, k) => c.Value.SetAsync(k, redisValule, null, exists)) == "OK"; if (expire > TimeSpan.Zero && exists == null) return await ExecuteScalar(key, (c, k) => c.Value.SetAsync(k, redisValule, expire, null)) == "OK"; if (expire > TimeSpan.Zero && exists != null) return await ExecuteScalar(key, (c, k) => c.Value.SetAsync(k, redisValule, expire, exists)) == "OK"; return false; }
await ExecuteScalar(key, (c, k) => c.Value.SetAsync(k, redisValule))
T GetAndExecute<T>(RedisClientPool pool, Func<Object<RedisClient>, T> handler, int jump = 100, int errtimes = 0) { Object<RedisClient> obj = null; Exception ex = null; var redirect = ParseClusterRedirect(null); try { obj = pool.Get(); while (true) { //因网络出错重试,默认1次 try { var ret = handler(obj); return ret; } catch (RedisException ex3) { redirect = ParseClusterRedirect(ex3); //官方集群跳转 if (redirect == null || jump <= 0) { ex = ex3; if (SentinelManager != null && ex.Message.Contains("READONLY")) { //哨兵轮询 if (pool.SetUnavailable(ex) == true) BackgroundGetSentinelMasterValue(); } throw ex; } break; }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
版本情况
CSRedis:3.6.6
Redis版本:4.0.10
重现步骤
故障表现
原因
await ExecuteScalar(key, (c, k) => c.Value.SetAsync(k, redisValule))
方法The text was updated successfully, but these errors were encountered: