reduced retry to single request and reset the error text line
This commit is contained in:
parent
6973ec64fe
commit
c5df95625d
@ -97,9 +97,10 @@ namespace BreCalClient
|
||||
var jitterer = new Random();
|
||||
|
||||
var retryPolicy =
|
||||
Policy.Handle<HttpRequestException>()
|
||||
.OrResult<RestSharp.RestResponse>(resp => resp.StatusCode == HttpStatusCode.Unauthorized)
|
||||
.WaitAndRetryAsync(3,
|
||||
// Policy.Handle<HttpRequestException>()
|
||||
Policy.HandleResult<RestSharp.RestResponse>(resp => resp.StatusCode == HttpStatusCode.Unauthorized)
|
||||
//.OrResult<RestSharp.RestResponse>
|
||||
.WaitAndRetryAsync(1,
|
||||
retryAttempt =>
|
||||
{
|
||||
var calculatedDelayInMilliseconds = Math.Pow(2, retryAttempt) * 1000;
|
||||
@ -114,6 +115,7 @@ namespace BreCalClient
|
||||
Trace.WriteLine("token refreshed");
|
||||
});
|
||||
RetryConfiguration.AsyncRetryPolicy = retryPolicy;
|
||||
|
||||
this.generalProgressStatus.Maximum = PROGRESS_STEPS;
|
||||
}
|
||||
|
||||
@ -445,6 +447,7 @@ namespace BreCalClient
|
||||
{
|
||||
labelGeneralStatus.Text = $"Connection {ConnectionStatus.SUCCESSFUL}";
|
||||
labelLatestUpdate.Text = $"Last update: {DateTime.Now.ToLongTimeString()}";
|
||||
labelStatusBar.Text = "";
|
||||
generalProgressStatus.Value = 0;
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user