Exemplo n.º 1
0
        public void ReLoadRedis()
        {
            try
            {
                RedisConfig = RedisSettingFactory.Load();

                ICacheSerializer serializer = RedisConfig.Serializer == StorageMode.Protobuf
                    ? (ICacheSerializer) new ProtobufCacheSerializer()
                    : new JsonCacheSerializer(Encoding.UTF8);

                RedisConnectionPool.Initialize(new RedisPoolSetting()
                {
                    Host             = RedisConfig.Host,
                    ReadOnlyHost     = RedisConfig.Host,
                    MaxWritePoolSize = 2,
                    MaxReadPoolSize  = 2,
                    DbIndex          = RedisConfig.Db
                }, serializer);

                var _redisSection = ConfigManager.Configger.GetFirstOrAddConfig <RedisSection>();
                if (_redisSection == null)
                {
                }
            }
            catch (Exception ex)
            {
                TraceLog.WriteError("ReLoadRedis error:{0}", ex);
            }
        }
Exemplo n.º 2
0
 private void Save()
 {
     RedisSettingFactory.Save(settingPropertyGrid.SelectedObject as RedisSetting);
 }