remove unused GitWithRetry
This commit is contained in:
parent
fdfeef8ad4
commit
0b2545b036
|
@ -243,32 +243,6 @@ class UpdateBuildOutput(steps.BuildStep):
|
||||||
return util.SUCCESS
|
return util.SUCCESS
|
||||||
|
|
||||||
|
|
||||||
# The builtin retry mechanism doesn't seem to work for github,
|
|
||||||
# since github is sometimes not delivering the pull request ref fast enough.
|
|
||||||
class GitWithRetry(steps.Git):
|
|
||||||
@defer.inlineCallbacks
|
|
||||||
def run_vc(
|
|
||||||
self,
|
|
||||||
branch: str,
|
|
||||||
revision: str,
|
|
||||||
patch: str,
|
|
||||||
) -> Generator[Any, object, Any]:
|
|
||||||
retry_counter = 0
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
res = yield super().run_vc(branch, revision, patch)
|
|
||||||
except Exception as e: # noqa: BLE001
|
|
||||||
retry_counter += 1
|
|
||||||
if retry_counter == 3:
|
|
||||||
msg = "Failed to clone"
|
|
||||||
raise BuildbotNixError(msg) from e
|
|
||||||
log: Log = yield self.addLog("log")
|
|
||||||
yield log.addStderr(f"Retrying git clone (error: {e})\n")
|
|
||||||
yield asyncSleep(2 << retry_counter) # 2, 4, 8
|
|
||||||
else:
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
def nix_eval_config(
|
def nix_eval_config(
|
||||||
project: GerritProject,
|
project: GerritProject,
|
||||||
gerrit_private_key: str,
|
gerrit_private_key: str,
|
||||||
|
|
Loading…
Reference in a new issue