Skip to content

Commit

Permalink
Disable global timeout for debug runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Jan 22, 2025
1 parent ece9940 commit 6dbdbfc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pub_stats_collector/lib/fetch_package_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ Future<Response> fetchPackageData(Request request, {bool debug = false}) async {
data,
);

await controller.fetchScores().timeout(
Duration(minutes: 10),
onTimeout: () => throw TimeoutException('Global timeout reached'),
);
final scoresFuture = controller.fetchScores();
if (debug) {
await scoresFuture;
} else {
await scoresFuture.timeout(
Duration(minutes: 10),
onTimeout: () => throw TimeoutException('Global timeout reached'),
);
}
} catch (e, stacktrace) {
print(e);
print(stacktrace);
Expand Down

0 comments on commit 6dbdbfc

Please sign in to comment.