diff --git a/pub_stats_collector/lib/fetch_package_data.dart b/pub_stats_collector/lib/fetch_package_data.dart index c1b33f3..72c8e89 100644 --- a/pub_stats_collector/lib/fetch_package_data.dart +++ b/pub_stats_collector/lib/fetch_package_data.dart @@ -44,15 +44,10 @@ Future 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);