csredis
csredis copied to clipboard
SAdd 一次性添加超过一定数量就会报由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。.
一次添加的是200条 连接字符串参数 abortConnect=false,connectTimeout=15000,syncTimeout=1500 使用的是同步的SAdd
var client = new CSRedisClient("xxx,abortConnect=false,connectTimeout=15000,syncTimeout=1500,password=xxx");
var newReadAuthorRobot = new List<string>
{
"123",
"456"
};
foreach (var element in Enumerable.Range(100, 200))
{
newReadAuthorRobot.Add(element.ToString().ToSerialNo());
}
foreach (var element in newReadAuthorRobot)
{
Console.Write(element+" ");
}
var result=client.SAdd("test:456",newReadAuthorRobot.ToArray());