Improve debug logging of github_helper

This commit is contained in:
Mikhail f. Shiryaev 2022-07-18 10:32:45 +02:00
parent 9cc06ea0e4
commit caef6729f4
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -135,6 +135,7 @@ class GitHub(github.Github):
if updated_at <= cached_pr.updated_at:
logger.debug("Getting PR #%s from cache", number)
return cached_pr
logger.debug("Getting PR #%s from API", number)
for i in range(self.retries):
try:
pr = repo.get_pull(number)
@ -143,7 +144,7 @@ class GitHub(github.Github):
if i == self.retries - 1:
raise
self.sleep_on_rate_limit()
logger.debug("Getting PR #%s from API", number)
logger.debug("Caching PR #%s from API in %s", number, pr_cache_file)
with open(pr_cache_file, "wb") as prfd:
self.dump(pr, prfd) # type: ignore
return pr