コード例 #1
0
        private RedisRedialManager()
        {
            var tmpRedisHost = ConfigurationManager.AppSettings["redialRedisServer"];

            if (!string.IsNullOrEmpty(tmpRedisHost))
            {
                RedisHost = tmpRedisHost;
            }
            else
            {
                throw new RedialException("Redial Redis Server did not set.");
            }

            redis = ConnectionMultiplexer.Connect(new ConfigurationOptions()
            {
                ServiceName    = RedisHost,
                ConnectTimeout = 5000,
                KeepAlive      = 8,
                EndPoints      =
                {
                    { RedisHost, 6379 }
                }
            });

            var redialSetting = GetRedialStatus();

            if (redialSetting == null)
            {
                SetRedialStatus(RunningRedialStatus);
            }

            AtomicExecutor = new FileLockerAtomicExecutor(this);
        }
コード例 #2
0
 public FileLockerRedialManager(INetworkValidater networkValidater, IRedialer redialer)
 {
     _lockerFilePath  = Path.Combine(SpiderEnviroment.GlobalDirectory, "redialer.lock");
     AtomicExecutor   = new FileLockerAtomicExecutor(this);
     NetworkValidater = networkValidater;
     Redialer         = redialer;
 }