csredis icon indicating copy to clipboard operation
csredis copied to clipboard

SAdd 一次性添加超过一定数量就会报由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。.

Open ForLR opened this issue 3 years ago • 1 comments

ForLR avatar Dec 15 '21 13:12 ForLR

一次添加的是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());

ForLR avatar Dec 15 '21 13:12 ForLR