private void RecordAttemptFailure(ConnectionState state, ErrorInfo error) { var attempt = Attempts.LastOrDefault() ?? new ConnectionAttempt(_now()); attempt.FailedStates.Add(new AttemptFailedState(state, error)); if (Attempts.Count == 0) { Attempts.Add(attempt); } }
public void RecordAttemptFailure(ConnectionState state, ErrorInfo error) { lock (_syncLock) { var attempt = Attempts.LastOrDefault() ?? new ConnectionAttempt(Config.Now()); attempt.FailedStates.Add(new AttemptFailedState(state, error)); if (Attempts.Count == 0) { Attempts.Add(attempt); } } }