OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async' hide TimeoutException; | 5 import 'dart:async' hide TimeoutException; |
6 import 'dart:io' hide HttpException; | 6 import 'dart:io' hide HttpException; |
7 | 7 |
8 import 'buildbot_data.dart'; | 8 import 'buildbot_data.dart'; |
9 import 'buildbot_loading.dart'; | 9 import 'buildbot_loading.dart'; |
10 import 'buildbot_structures.dart'; | 10 import 'buildbot_structures.dart'; |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 @override | 29 @override |
30 Future<BuildResult> readResult(BuildUri buildUri) async { | 30 Future<BuildResult> readResult(BuildUri buildUri) async { |
31 Duration timeout; | 31 Duration timeout; |
32 if (buildUri.buildNumber < 0) { | 32 if (buildUri.buildNumber < 0) { |
33 timeout = new Duration(seconds: 1); | 33 timeout = new Duration(seconds: 1); |
34 } | 34 } |
35 | 35 |
36 void skipToPreviousBuildNumber() { | 36 void skipToPreviousBuildNumber() { |
37 BuildUri prevBuildUri = buildUri.prev(); | 37 BuildUri prevBuildUri = buildUri.prev(); |
38 log('Skip build number ' | 38 log('Skip build number on ${buildUri} -> ${prevBuildUri.buildNumber}'); |
39 '${buildUri.buildNumber} -> ${prevBuildUri.buildNumber}'); | |
40 buildUri = buildUri.prev(); | 39 buildUri = buildUri.prev(); |
41 } | 40 } |
42 | 41 |
43 while (true) { | 42 while (true) { |
44 try { | 43 try { |
45 return await readBuildResultFromHttp(_client, buildUri, timeout); | 44 return await readBuildResultFromHttp(_client, buildUri, timeout); |
46 } on TimeoutException { | 45 } on TimeoutException { |
47 if (timeout != null) { | 46 if (timeout != null) { |
48 skipToPreviousBuildNumber(); | 47 skipToPreviousBuildNumber(); |
49 continue; | 48 continue; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 buildUri = buildUri.withBuildNumber(buildNumber); | 112 buildUri = buildUri.withBuildNumber(buildNumber); |
114 } | 113 } |
115 } | 114 } |
116 } | 115 } |
117 | 116 |
118 @override | 117 @override |
119 void close() { | 118 void close() { |
120 // Nothing to do. | 119 // Nothing to do. |
121 } | 120 } |
122 } | 121 } |
OLD | NEW |