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); }
public FileLockerRedialManager(INetworkValidater networkValidater, IRedialer redialer) { _lockerFilePath = Path.Combine(SpiderEnviroment.GlobalDirectory, "redialer.lock"); AtomicExecutor = new FileLockerAtomicExecutor(this); NetworkValidater = networkValidater; Redialer = redialer; }