static RedisHelper() { RedisConfigInfoSection redis = RedisConfigInfoSection.GetConfig(); RedisReadWritePath = redis.WriteServerList; RedisReadPath = redis.ReadServerList; prcm = CreateManager(new string[] { RedisReadWritePath }, new string[] { RedisReadPath }, redis.MaxWritePoolSize, redis.MaxReadPoolSize); }
public static RedisConfigInfoSection GetConfig(string sectionName) { RedisConfigInfoSection section = null; try { section = (RedisConfigInfoSection)ConfigurationManager.GetSection(sectionName); } catch (Exception ex) { logger.Error(ex.Message); throw new ConfigurationErrorsException("Section " + sectionName + " is error."); } if (section == null) { logger.Error("Section " + sectionName + " is not found."); throw new ConfigurationErrorsException("Section " + sectionName + " is not found."); } return(section); }