Skip to content

Commit

Permalink
Merged master into branch to handle conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasSort committed Aug 27, 2024
2 parents aafe128 + 8ee1bf9 commit cbd457c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ODataSourceReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ private IEnumerable<Dictionary<string, object>> ExtractStream(Stream responseStr
yield return null;
}

private bool HandleRequest(string url, string loggerInfo, IDictionary<string, string> headers)
private bool HandleRequest(string url, string loggerInfo, IDictionary<string, string> headers, int retryCounter = 0)
{
if (CheckIfEndpointIsReadyForUse(url))
{
Expand Down Expand Up @@ -598,6 +598,15 @@ private bool HandleRequest(string url, string loggerInfo, IDictionary<string, st
else
{
_logger?.Info($"Endpoint: '{_endpoint.Name}' is not ready for use on URL: '{url}'");
if (retryCounter < 2)
{
retryCounter++;
_logger?.Info($"Will wait and retry again in 5 seconds.");
Thread.Sleep(5000);
_logger?.Info($"This is retry {retryCounter} out of 2");
HandleRequest(url, loggerInfo, headers, retryCounter);
}

return false;
}
}
Expand Down

0 comments on commit cbd457c

Please sign in to comment.