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

turn up the debug level #361

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
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
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