diff options
| -rw-r--r-- | tools/webhook_installer/installer.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/webhook_installer/installer.py b/tools/webhook_installer/installer.py index 48d5367..ba1cfae 100644 --- a/tools/webhook_installer/installer.py +++ b/tools/webhook_installer/installer.py @@ -19,6 +19,7 @@ import urllib.parse import urllib.error import base64 import argparse +from time import sleep from os import environ as envs from urllib.parse import unquote, quote @@ -219,6 +220,7 @@ def update_gerrit_repo_webhooks(repo, target_webhooks_config_content, commit_sub gerrit_repos_with_webhooks_to_update_failed.append(repo) return None + sleep(2) # Small delay to ensure Gerrit is ready for the next operation # Upload the webhooks.config file to the change request if args.simulate: @@ -266,6 +268,8 @@ def update_gerrit_repo_webhooks(repo, target_webhooks_config_content, commit_sub gerrit_repos_with_webhooks_to_update_failed.append(repo) return None + sleep(2) + # Publish the change request (only if upload was successful and not a 409) if args.simulate: logger.info("Simulating publishing change request " + change_request_id @@ -289,6 +293,8 @@ def update_gerrit_repo_webhooks(repo, target_webhooks_config_content, commit_sub logger.error("Failed to connect to gerrit: %s", err.reason) sys.exit(1) + sleep(2) + # Self-review the change request if args.simulate: logger.info("Simulating self-reviewing change request " + change_request_id @@ -314,6 +320,8 @@ def update_gerrit_repo_webhooks(repo, target_webhooks_config_content, commit_sub logger.error("Failed to connect to gerrit: %s", err.reason) sys.exit(1) + sleep(2) + # Submit the change request if args.simulate: logger.info("Simulating submitting change request " + change_request_id |
