예제 #1
0
        private void HandleCoolDown()
        {
            // TODO: [TESTS] (RabbitConnection.HandleCoolDown) Add tests
            _connectionErrorCount = 0;
            _coolDownRunCount    += 1;

            // If configured, and hit - disable the connection after "x" cooldown runs
            if (_config.MaxCoolDownRuns > 0 && _coolDownRunCount > _config.MaxCoolDownRuns)
            {
                HandleMaxCoolDownRuns();
                return;
            }

            // Enter into a cooldown in hopes that the RabbitMQ connection will come back
            _disabledUntil = _dateTime.Now.AddSeconds(_config.CoolDownTimeSec);

            _logger.Warning(
                "Failed to communicate with RabbitMQ {x} time(s) in a row - backing off until {d}",
                _config.CoolDownThreshold,
                _disabledUntil
                );
        }
예제 #2
0
 public void Warning(string message)
 {
     Logger.Warning(message);
 }