尝试运行此代码时出现Timeout错误:
List<HashEntry> entries = new List<HashEntry>();
for (i = 0; i < 10000; i++)
{
var extension = new Extension
{
Name = RandomString(30),
LastName = RandomString(30),
Number = random.Next(),
};
entries.Add(new HashEntry(extension.Name, JsonConvert.SerializeObject(extension)));
}
cache.HashSet("extensions", entries.ToArray());
此异常发生在最后一行:
未处理的类型&#39; System.TimeoutException&#39;发生在StackExchange.Redis.dll
中附加信息:超时执行HMSET扩展,inst:0,mgr:无效,队列:2,qu = 1,qs = 1,qc = 0,wr = 1/1,in = 0/0
答案 0 :(得分:0)
解决方案是在连接配置中添加“synctimeout”参数。