Do not fail the run on error updating status comment

This commit is contained in:
Mikhail f. Shiryaev 2023-05-02 12:34:40 +02:00
parent 1590ba3326
commit ca19f20aff
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -101,7 +101,21 @@ def post_commit_status(
raise ex
time.sleep(i)
if pr_info:
set_status_comment(commit, pr_info)
status_updated = False
for i in range(RETRY):
try:
set_status_comment(commit, pr_info)
status_updated = True
break
except Exception as ex:
logging.warning(
"Failed to update the status commit, will retry %s times: %s",
RETRY - i - 1,
ex,
)
if not status_updated:
logging.error("Failed to update the status comment, continue anyway")
def set_status_comment(commit: Commit, pr_info: PRInfo) -> None: