Beispiel #1
0
 public RedisCache(IBotCredentials creds)
 {
     Redis = ConnectionMultiplexer.Connect("127.0.0.1");
     Redis.PreserveAsyncOrder = false;
     LocalImages = new RedisImagesCache(Redis, creds);
     LocalData   = new RedisLocalDataCache(Redis, creds);
     _db         = Redis.GetDatabase();
     _redisKey   = creds.RedisKey();
 }
Beispiel #2
0
 public RedisCache(IBotCredentials creds)
 {
     _log  = LogManager.GetCurrentClassLogger();
     Redis = ConnectionMultiplexer.Connect("127.0.0.1");
     Redis.PreserveAsyncOrder = false;
     LocalImages = new RedisImagesCache(Redis, creds);
     LocalData   = new RedisLocalDataCache(Redis, creds);
     _redisKey   = creds.RedisKey();
 }
Beispiel #3
0
        public RedisCache(IBotCredentials creds, int shardId)
        {
            var conf = ConfigurationOptions.Parse(creds.RedisOptions);

            Redis                    = ConnectionMultiplexer.Connect(conf);
            _redisEndpoint           = Redis.GetEndPoints().First();
            Redis.PreserveAsyncOrder = false;
            LocalImages              = new RedisImagesCache(Redis, creds);
            LocalData                = new RedisLocalDataCache(Redis, creds, shardId);
            _redisKey                = creds.RedisKey();
        }
Beispiel #4
0
        public RedisCache(IBotCredentials creds, int shardId)
        {
            _log = LogManager.GetCurrentClassLogger();
            var conf = ConfigurationOptions.Parse("127.0.0.1");

            conf.SyncTimeout         = 3000;
            Redis                    = ConnectionMultiplexer.Connect(conf);
            Redis.PreserveAsyncOrder = false;
            LocalImages              = new RedisImagesCache(Redis, creds);
            LocalData                = new RedisLocalDataCache(Redis, creds, shardId);
            _redisKey                = creds.RedisKey();
        }
Beispiel #5
0
        public RedisCache(IBotCredentials creds, int shardId)
        {
            _log = LogManager.GetCurrentClassLogger();

            ConfigurationOptions conf;

            if (!string.IsNullOrWhiteSpace(creds.RedisOptions))
            {
                conf = ConfigurationOptions.Parse(creds.RedisOptions);
            }
            else
            {
                conf = ConfigurationOptions.Parse("127.0.0.1,syncTimeout=3000");
            }

            Redis = ConnectionMultiplexer.Connect(conf);
            Redis.PreserveAsyncOrder = false;
            LocalImages = new RedisImagesCache(Redis, creds);
            LocalData   = new RedisLocalDataCache(Redis, creds, shardId);
            _redisKey   = creds.RedisKey();
        }