问题描述
Configurationoptions options = new()
{
AllowAdmin = true,ServiceName = "mymaster",KeepAlive = 86400,AbortOnConnectFail = false,ConnectRetry = 5,ConnectTimeout = 5000,SyncTimeout = 5000,ReconnectRetryPolicy = new LinearRetry(5000),EndPoints = { { configuration.GetValue<string>(REdis_HOST),26379 } },Password = configuration.GetValue<string>(REdis_PASSWORD)
};
ConnectionMultiplexer redis = ConnectionMultiplexer.SentinelConnect(options,Console.Out);
return redis;
根据上面的建议,我删除了 CommandMap 。但是我仍然收到以下错误 -
此操作已在命令映射中禁用且无法使用:GET
[20:30:28 ERR] at StackExchange.Redis.CommandMap.AssertAvailable(RedisCommand command) in /_/src/StackExchange.Redis/CommandMap.cs:line 169
at StackExchange.Redis.ConnectionMultiplexer.CheckMessage(Message message) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 524
at StackExchange.Redis.RedisBase.ExecuteAsync[T](Message message,ResultProcessor`1 processor,ServerEndPoint server) in /_/src/StackExchange.Redis/RedisBase.cs:line 46
at StackExchange.Redis.RedisDatabase.StringGetAsync(RedisKey key,CommandFlags flags) in /_/src/StackExchange.Redis/RedisDatabase.cs:line 2430
at App.Core.RedisCache.RedisConnectionMultiplexer.GetVehicleKey(String IMEI) in D:\Personal\Upwork\Behrad\IoT-App\App.Core\RedisCache\RedisConnectionMultiplexer.cs:line 66
at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action,Context context,CancellationToken cancellationToken,ExceptionPredicates shouldRetryExceptionPredicates,ResultPredicates`1 shouldRetryResultPredicates,Func`5 onRetryAsync,Int32 permittedRetryCount,IEnumerable`1 sleepDurationsEnumerable,Func`4 sleepDurationProvider,Boolean continueOnCapturedContext)
at Polly.AsyncPolicy.ExecuteAsync[TResult](Func`3 action,Boolean continueOnCapturedContext)
at App.Core.Processor.MessageProcessor.<>c__displayClass6_0.<<ProcessAsync>b__2>d.MoveNext() in D:\Personal\Upwork\Behrad\IoT-App\App.Core\Processor\Processor.cs:line 65
StackExchange.Redis.RedisCommandException: This operation has been disabled in the command-map and cannot be used: GET
at StackExchange.Redis.CommandMap.AssertAvailable(RedisCommand command) in /_/src/StackExchange.Redis/CommandMap.cs:line 169
at StackExchange.Redis.ConnectionMultiplexer.CheckMessage(Message message) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 524
at StackExchange.Redis.RedisBase.ExecuteAsync[T](Message message,Boolean continueOnCapturedContext)
即使使用 mygate 的最新版本,我也无法弄清楚这一点 -
<packagereference Include="StackExchange.Redis" Version="2.2.31" />
<packagereference Include="StackExchange.Redis.Extensions.Core" Version="7.0.1" />
我已经实施了以下提供的建议。但无论如何都没有用- https://github.com/StackExchange/StackExchange.Redis/issues/1518
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)