Skip to content

Commit 66a6d0f

Browse files
author
Andrii Bondarchuk
committed
Add warning log for empty activity portion in lactate sync function
1 parent 9e0dc14 commit 66a6d0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/FitSyncHub.Functions/Functions/LactateSyncHttpTriggerFunction.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ private async Task<List<ActivityResponse>> FetchActivities(DateTime oldestDate,
203203
var nextPageExists = activitiesPortionWithStravaActivities.Count == Limit;
204204

205205
var portion = activitiesPortionWithStravaActivities.WhereNotNull().ToList();
206+
if (portion.Count == 0)
207+
{
208+
_logger.LogWarning("No activities found for date range {OldestDate} - {NewestDate}", oldestDate, newestDate);
209+
break;
210+
}
211+
206212
activities.AddRange(portion);
207213

208214
newestDate = portion.Min(x => x.StartDate.Date);

0 commit comments

Comments
 (0)