问题描述
我正在使用 Azure RedisCache,当我调用以下命令时:
_cache.KeyDelete(key,CommandFlags.HighPriority)
密钥没有被删除,也没有错误。
同样,如果已经设置了键/值,以下操作也不起作用:
_cache.StringSet(dataKey,"")
_cache.KeyExpire(dataKey,DateTime.UtcNow.AddDays(-2),CommandFlags.HighPriority)
解决方法
确保在配置字符串中启用 allowAdmin=true
或 Configuarationoptions
您可以查看解决类似问题的 SO 线程。