Sequencing.WeatherApp.Controllers.AppChain.SqApiServiceFacade.RunRq C# (CSharp) Method

RunRq() private method

Runs requests, is executed several times in case of error - request is attempted with refreshed auth data
private RunRq ( RestSharp.RestClient _restClient, RestRequest _restRequest ) : IRestResponse
_restClient RestSharp.RestClient
_restRequest RestSharp.RestRequest
return IRestResponse
        private IRestResponse RunRq(RestClient _restClient, RestRequest _restRequest)
        {
            IRestResponse _restResponse = null;
            for (int _idx = 0; _idx < 5; _idx++)
            {
                _restResponse = _restClient.Execute(_restRequest);
                if (_restResponse.StatusCode != HttpStatusCode.OK)
                {
                    var _userInfo = userAuthWorker.GetCurrent();
                    var _newInfo =
                        new AuthWorker(Options.OAuthUrl, Options.OAuthRedirectUrl, Options.OAuthSecret,
                            Options.OAuthAppId).RefreshToken(_userInfo.RefreshToken);
                    if (!_newInfo.Success)
                        throw new Exception("Error while token refresh:" + _userInfo.RefreshToken+"," + _newInfo.ErrorMessage);
                    _userInfo.AuthToken = _newInfo.Token.access_token;
                    var _updateToken = userAuthWorker.UpdateToken(_userInfo);
                    _restClient.Authenticator = new OAuth2AuthorizationRequestHeaderAuthenticator(_updateToken.AuthToken);
                    _restRequest.Parameters.RemoveAll(parameter => parameter.Name == "Authorization");
                    _restResponse = _restClient.Execute(_restRequest);
                }
                if (_restResponse.StatusCode == HttpStatusCode.OK)
                    return _restResponse;
                Thread.Sleep(5*1000);
            }
            return _restResponse;
        }