Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log level and wording #831

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions ogr/services/pagure/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def get_files_diff(
retries: Number of extra attempts.
wait_seconds: Delay between attempts.
"""
attempt = 0
attempt = 1
while True:
try:
return project._call_project_api(
Expand All @@ -224,14 +224,14 @@ def get_files_diff(
except PagureAPIException as ex: # noqa PERF203
if "No statistics" in ex.pagure_error:
# this may be a race condition, try once more
logger.error(
f"While retrieving PR diffstats Pagure returned ENOPRSTATS. \n{ex}",
logger.info(
f"While retrieving PR diffstats Pagure returned ENOPRSTATS.\n{ex}",
)
if attempt < retries:
logger.error(
f"Trying again; attempt={attempt} after {wait_seconds}seconds",
)
if attempt <= retries:
attempt += 1
logger.info(
f"Trying again; attempt={attempt} after {wait_seconds} seconds",
)
sleep(wait_seconds)
continue
raise ex
Expand Down