NServiceBus.RepeatedFailuresOverTimeCircuitBreaker.Failure C# (CSharp) Method

Failure() public method

public Failure ( Exception exception ) : Task
exception System.Exception
return Task
        public Task Failure(Exception exception)
        {
            lastException = exception;
            var newValue = Interlocked.Increment(ref failureCount);

            if (newValue == 1)
            {
                timer.Change(timeToWaitBeforeTriggering, NoPeriodicTriggering);
                Logger.WarnFormat("The circuit breaker for {0} is now in the armed state", name);
            }

            return Task.Delay(TimeSpan.FromSeconds(1));
        }