From 6fa4de4eb6b29c5f5f31652fad5790f1bd028b99 Mon Sep 17 00:00:00 2001 From: Mike Stall Date: Wed, 30 Nov 2016 14:32:01 -0800 Subject: [PATCH] Tactical fix for https://github.com/Azure/azure-webjobs-sdk/issues/929 Proper fix comes once https://github.com/projectkudu/AzureFunctionsPortal/issues/634is fixed and then we can remove the whole function. --- .../Internal/LogReader.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Microsoft.Azure.WebJobs.Logging/Internal/LogReader.cs b/src/Microsoft.Azure.WebJobs.Logging/Internal/LogReader.cs index 7a8becec9..13f815488 100644 --- a/src/Microsoft.Azure.WebJobs.Logging/Internal/LogReader.cs +++ b/src/Microsoft.Azure.WebJobs.Logging/Internal/LogReader.cs @@ -254,6 +254,16 @@ DateTime endTime var segment = await SafeExecuteQuerySegmentedAsync(rangeQuery, startTime, endTime, continuationToken); list.AddRange(segment.Results); + + if (rangeQuery.TakeCount.HasValue) + { + // Don't need to return more entries than were requested. + if (list.Count >= rangeQuery.TakeCount.Value) + { + segment.ContinuationToken = null; + } + } + if (segment.ContinuationToken == null) { // Done!