Skip to content

Commit

Permalink
Merge pull request #2139 from solliancenet/cjg-pending-polling
Browse files Browse the repository at this point in the history
  • Loading branch information
ciprianjichici authored Jan 18, 2025
2 parents 77be15d + bc177a9 commit 1edb34a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dotnet/Common/Clients/PollingHttpClient`2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public async Task<LongRunningOperation> GetOperationStatusAsync(string operation
var pollingStartTime = DateTime.UtcNow;
var pollingCounter = 0;

await Task.Delay(_pollingInterval, cancellationToken);

while (true)
{
if (cancellationToken.IsCancellationRequested)
Expand Down Expand Up @@ -175,6 +177,7 @@ public async Task<LongRunningOperation> GetOperationStatusAsync(string operation
}
return default;
case OperationStatus.InProgress:
case OperationStatus.Pending:
if (totalPollingTime > _maxWaitTime)
{
_logger.LogWarning("Total polling time ({TotalTime} seconds) exceeded to maximum allowed ({MaxTime} seconds).",
Expand Down

0 comments on commit 1edb34a

Please sign in to comment.