Skip to content

Commit

Permalink
turn up the debug level
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Nov 24, 2023
1 parent 2dd658e commit 7a12af0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions adabot/github_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def request(method, url, **kwargs):
"See log for error text that has been sanitized for secrets"
) from None

if not from_cache:
if remaining % 100 == 0 or remaining < 20:
logging.info("%d requests remaining this hour", remaining)
if not from_cache and remaining <= 1:
rate_limit_reset = datetime.datetime.fromtimestamp(
int(response.headers["X-RateLimit-Reset"])
Expand All @@ -96,9 +99,6 @@ def request(method, url, **kwargs):
logging.info("Sleeping %s seconds", reset_diff.seconds)
time.sleep(reset_diff.seconds + 1)

if remaining % 100 == 0:
logging.info(remaining, "requests remaining this hour")

return response


Expand Down
2 changes: 1 addition & 1 deletion adabot/update_cp_org_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

logger = logging.getLogger(__name__)
ch = logging.StreamHandler(stream=sys.stdout)
logging.basicConfig(format="%(message)s", handlers=[ch])
logging.basicConfig(level=logging.DEBUG, format="%(message)s", handlers=[ch])


DO_NOT_VALIDATE = [
Expand Down

0 comments on commit 7a12af0

Please sign in to comment.