Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Microsoft.Graph.Core/Tasks/PageIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private async Task<bool> IntrapageIterateAsync()

while (_pageItemQueue.Count != 0) // && shouldContinue)
{
bool shouldContinue = IsProcessPageItemCallbackAsync ? await _asyncProcessPageItemCallback(_pageItemQueue.Dequeue()) : _processPageItemCallback(_pageItemQueue.Dequeue());
bool shouldContinue = IsProcessPageItemCallbackAsync ? await _asyncProcessPageItemCallback(_pageItemQueue.Dequeue()).ConfigureAwait(false) : _processPageItemCallback(_pageItemQueue.Dequeue());

// Cancel processing of items in the page and stop requesting more pages.
if (!shouldContinue)
Expand Down Expand Up @@ -261,7 +261,7 @@ private async Task InterpageIterateAsync(CancellationToken token)
};
// if we have a request configurator, modify the request as desired then execute it to get the next page
nextPageRequestInformation = _requestConfigurator == null ? nextPageRequestInformation : _requestConfigurator(nextPageRequestInformation);
_currentPage = await _requestAdapter.SendAsync<TCollectionPage>(nextPageRequestInformation, (parseNode) => new TCollectionPage(), _errorMapping, token);
_currentPage = await _requestAdapter.SendAsync<TCollectionPage>(nextPageRequestInformation, (parseNode) => new TCollectionPage(), _errorMapping, token).ConfigureAwait(false);

var pageItems = ExtractEntityListFromParsable(_currentPage);
// Add all of the items returned in the response to the queue.
Expand Down Expand Up @@ -318,7 +318,7 @@ public async Task IterateAsync(CancellationToken token)
// Iterate over the contents of queue. The queue could be from the initial page
// results passed to the iterator, the results of a delta query, or from a
// previously cancelled iteration that gets resumed.
bool shouldContinueInterpageIteration = await IntrapageIterateAsync();
bool shouldContinueInterpageIteration = await IntrapageIterateAsync().ConfigureAwait(false);

// Request more pages if they are available.
while (shouldContinueInterpageIteration && !token.IsCancellationRequested)
Expand All @@ -328,7 +328,7 @@ public async Task IterateAsync(CancellationToken token)

// Iterate over items added to the queue by InterpageIterateAsync and
// determine whether there are more pages to request.
shouldContinueInterpageIteration = await IntrapageIterateAsync();
shouldContinueInterpageIteration = await IntrapageIterateAsync().ConfigureAwait(false);
}
}

Expand Down