|
17 | 17 | import datetime |
18 | 18 | import enum |
19 | 19 | import itertools |
| 20 | +import retrying |
20 | 21 | from typing import Any, FrozenSet, Iterable, List, Mapping, Optional |
21 | 22 |
|
22 | 23 | from google.cloud import bigquery |
@@ -234,6 +235,8 @@ def get_self_compatibility(self, |
234 | 235 | """ |
235 | 236 | return self.get_self_compatibilities([p])[p] |
236 | 237 |
|
| 238 | + @retrying.retry(stop_max_attempt_number=7, |
| 239 | + wait_fixed=2000) |
237 | 240 | def get_self_compatibilities(self, |
238 | 241 | packages: Iterable[package.Package]) -> \ |
239 | 242 | Mapping[package.Package, List[CompatibilityResult]]: |
@@ -277,6 +280,8 @@ def get_self_compatibilities(self, |
277 | 280 | return {p: self._filter_older_versions(crs) |
278 | 281 | for (p, crs) in package_to_result.items()} |
279 | 282 |
|
| 283 | + @retrying.retry(stop_max_attempt_number=7, |
| 284 | + wait_fixed=2000) |
280 | 285 | def get_pair_compatibility(self, packages: List[package.Package]) -> \ |
281 | 286 | Iterable[CompatibilityResult]: |
282 | 287 | """Returns CompatibilityStatuses for a pair of packages. |
@@ -317,6 +322,8 @@ def get_pair_compatibility(self, packages: List[package.Package]) -> \ |
317 | 322 | self._row_to_compatibility_status(packages, row) |
318 | 323 | for row in query_job) |
319 | 324 |
|
| 325 | + @retrying.retry(stop_max_attempt_number=7, |
| 326 | + wait_fixed=2000) |
320 | 327 | def get_compatibility_combinations(self, |
321 | 328 | packages: List[package.Package]) -> \ |
322 | 329 | Mapping[FrozenSet[package.Package], List[CompatibilityResult]]: |
@@ -409,7 +416,8 @@ def save_compatibility_statuses( |
409 | 416 | self._release_time_table, |
410 | 417 | row) |
411 | 418 |
|
412 | | - |
| 419 | + @retrying.retry(stop_max_attempt_number=7, |
| 420 | + wait_fixed=2000) |
413 | 421 | def get_dependency_info(self, package_name): |
414 | 422 | """Returns dependency info for an indicated Google OSS package. |
415 | 423 |
|
|
0 commit comments