Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: tools/gardening/lib/src/bot.dart

Issue 2999433002: Fix `bot summary` when URIs couldn't be read. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gardening/bin/summary.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gardening/lib/src/bot.dart
diff --git a/tools/gardening/lib/src/bot.dart b/tools/gardening/lib/src/bot.dart
index c0cce3cd24d71509dbbc6cb0b0cc1656c26f82c9..2d5eb3bcb32b7448167a4795d45eaefaa77d054a 100644
--- a/tools/gardening/lib/src/bot.dart
+++ b/tools/gardening/lib/src/bot.dart
@@ -38,6 +38,10 @@ class Bot {
return _client.readResult(buildUri);
}
+ /// Reads the build results of all given uris.
+ ///
+ /// Returns a list of the results. If a uri couldn't be read, then the entry
+ /// in the list is `null`.
Future<List<BuildResult>> readResults(List<BuildUri> buildUris) async {
var result = <BuildResult>[];
int i = 0;
@@ -47,7 +51,13 @@ class Bot {
if (end > buildUris.length) end = buildUris.length;
var parallelChunk = buildUris.sublist(i, end);
log("Fetching ${end - i} uris in parallel");
- result.addAll(await Future.wait(parallelChunk.map(_client.readResult)));
+ result.addAll(await Future.wait(parallelChunk.map((uri) {
+ var result = _client.readResult(uri);
+ if (result == null) {
+ log("Error while reading $uri");
+ }
+ return result;
+ })));
i = end + 1;
}
return result;
« no previous file with comments | « tools/gardening/bin/summary.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698