Skip to content

Commit 562d100

Browse files
committed
short-circuit loop after failed request
1 parent 224a240 commit 562d100

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ServiceStack/src/ServiceStack.Jobs/SqliteRequestLogger.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ public AnalyticsReports GetAnalyticsReports(AnalyticsConfig config, DateTime mon
460460
Logger?.LogWarning(e, "GetAnalyticsReports(): SELECT RequestLog WHERE Id > {LastPk}: {Message}",
461461
lastPk, e.Message);
462462
lastPk += config.BatchSize; // avoid infinite loops
463+
continue;
463464
}
464465

465466
foreach (var requestLog in batch)
@@ -521,6 +522,7 @@ public AnalyticsReports GetApiAnalytics(AnalyticsConfig config, DateTime month,
521522
Logger?.LogWarning(e, "GetApiAnalytics(): SELECT RequestLog WHERE Id > {LastPk} AND OperationName = {Op}: {Message}",
522523
lastPk, op, e.Message);
523524
lastPk += config.BatchSize; // avoid infinite loops
525+
continue;
524526
}
525527

526528
foreach (var requestLog in batch)
@@ -594,6 +596,7 @@ public AnalyticsReports GetUserAnalytics(AnalyticsConfig config, DateTime month,
594596
Logger?.LogWarning(e, "GetUserAnalytics(): SELECT RequestLog WHERE Id > {LastPk} AND UserAuthId = {UserId}: {Message}",
595597
lastPk, userId, e.Message);
596598
lastPk += config.BatchSize; // avoid infinite loops
599+
continue;
597600
}
598601

599602
foreach (var requestLog in batch)
@@ -670,6 +673,7 @@ public AnalyticsReports GetApiKeyAnalytics(AnalyticsConfig config, DateTime mont
670673
Logger?.LogWarning(e, "GetApiKeyAnalytics(): SELECT RequestLog WHERE Id > {LastPk}: {Message}",
671674
lastPk, e.Message);
672675
lastPk += config.BatchSize; // avoid infinite loops
676+
continue;
673677
}
674678

675679
foreach (var requestLog in batch)
@@ -745,6 +749,7 @@ public AnalyticsReports GetIpAnalytics(AnalyticsConfig config, DateTime month, s
745749
Logger?.LogWarning(e, "GetIpAnalytics(): SELECT RequestLog WHERE Id > {LastPk} AND IpAddress = {Ip}: {Message}",
746750
lastPk, ip, e.Message);
747751
lastPk += config.BatchSize; // avoid infinite loops
752+
continue;
748753
}
749754

750755
foreach (var requestLog in batch)

ServiceStack/src/ServiceStack.Server/DbRequestLogger.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ public AnalyticsReports GetAnalyticsReports(AnalyticsConfig config, DateTime mon
589589
Logger?.LogWarning(e, "GetAnalyticsReports(): SELECT RequestLog WHERE Id > {LastPk}: {Message}",
590590
lastPk, e.Message);
591591
lastPk += config.BatchSize; // avoid infinite loops
592+
continue;
592593
}
593594

594595
foreach (var requestLog in batch)
@@ -650,6 +651,7 @@ public AnalyticsReports GetApiAnalytics(AnalyticsConfig config, DateTime month,
650651
Logger?.LogWarning(e, "GetApiAnalytics(): SELECT RequestLog WHERE Id > {LastPk} AND OperationName = {Op}: {Message}",
651652
lastPk, op, e.Message);
652653
lastPk += config.BatchSize; // avoid infinite loops
654+
continue;
653655
}
654656

655657
foreach (var requestLog in batch)
@@ -723,6 +725,7 @@ public AnalyticsReports GetUserAnalytics(AnalyticsConfig config, DateTime month,
723725
Logger?.LogWarning(e, "GetUserAnalytics(): SELECT RequestLog WHERE Id > {LastPk} AND UserAuthId = {UserId}: {Message}",
724726
lastPk, userId, e.Message);
725727
lastPk += config.BatchSize; // avoid infinite loops
728+
continue;
726729
}
727730

728731
foreach (var requestLog in batch)
@@ -801,6 +804,7 @@ public AnalyticsReports GetApiKeyAnalytics(AnalyticsConfig config, DateTime mont
801804
Logger?.LogWarning(e, "GetApiKeyAnalytics(): SELECT RequestLog WHERE Id > {LastPk}: {Message}",
802805
lastPk, e.Message);
803806
lastPk += config.BatchSize; // avoid infinite loops
807+
continue;
804808
}
805809

806810
foreach (var requestLog in batch)
@@ -876,6 +880,7 @@ public AnalyticsReports GetIpAnalytics(AnalyticsConfig config, DateTime month, s
876880
Logger?.LogWarning(e, "GetIpAnalytics(): SELECT RequestLog WHERE Id > {LastPk} AND IpAddress = {Ip}: {Message}",
877881
lastPk, ip, e.Message);
878882
lastPk += config.BatchSize; // avoid infinite loops
883+
continue;
879884
}
880885

881886
foreach (var requestLog in batch)

0 commit comments

Comments
 (0)