mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 08:49:52 +00:00
Fix bot summary
when URIs couldn't be read.
R=johnniwinther@google.com Review-Url: https://codereview.chromium.org/2999433002 .
This commit is contained in:
parent
33f1fc8059
commit
aaf67e5050
|
@ -26,7 +26,7 @@ main(List<String> args) async {
|
|||
var recentUris = bot.mostRecentUris;
|
||||
var results = await bot.readResults(recentUris);
|
||||
results.forEach((result) {
|
||||
if (result.hasFailures) {
|
||||
if (result != null && result.hasFailures) {
|
||||
print("${result.buildUri} has failures.");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue