函数超时问题
我要连一个redis的数据库,我在webconfig里配置了<appSettings>
<add key="strRedisConn" value="***.**.***.***:****"/>(注:此value为服务器ip,可通的)
</appSettings>
然后我写了个类如下:
private static string[] rwHosts()
{
string[] rwhosts = new string[1];
rwhosts[0] = ConfigurationManager.AppSettings["strRedisConn"];
return rwhosts;
}
private static string[] rHosts()
{
string[] rhosts = new string[1];
rhosts[0] = ConfigurationManager.AppSettings["strRedisConn"];
return rhosts;
}
private static PooledRedisClientManager prcm = jzManager.CreateRedisManager(
rwHosts(), //读写服务器
rHosts() //只读服务器
);
/// <summary>
/// 创建Redis连接池管理对象
/// </summary>
public static PooledRedisClientManager CreateRedisManager(string[] readWriteHosts, string[] readOnlyHosts)
{
//支持读写分离,均衡负载
return new PooledRedisClientManager(readWriteHosts, readOnlyHosts, new RedisClientManagerConfig
{
MaxWritePoolSize = 5,
//“写”链接池数
MaxReadPoolSize = 5,
//“读”链接池数
AutoStart = true,
});
}
/// <summary>
/// 读取数据
/// </summary>
public static T Get<T>(string key)
{
using (IRedisClient rds = prcm.GetReadOnlyClient())
{
return rds.Get<T>(key);
}
}
但是当我调用这个get方法时,我断点跟踪到IRedisClient rds = prcm.GetReadOnlyClient()时发现rds里面有问题,显示的都是:
由于以前的函数求值超时,函数求值被禁用。必须继续执行才能重新启用函数求值。
请大家帮忙下,这是怎么回事,如何才能看到我要的返回值呢
------解决方案--------------------
你看下web.config里面限制时间的为多少,比如timeout节点