Skip to content

Commit

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

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

0 comments on commit 677791b

Please sign in to comment.