Skip to content

Commit 53dabc8

Browse files
authored
Merge pull request #361 from adafruit/add-debugging
turn up the debug level
2 parents 2dd658e + 7a12af0 commit 53dabc8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

adabot/github_requests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ def request(method, url, **kwargs):
8282
"See log for error text that has been sanitized for secrets"
8383
) from None
8484

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

99-
if remaining % 100 == 0:
100-
logging.info(remaining, "requests remaining this hour")
101-
102102
return response
103103

104104

adabot/update_cp_org_libraries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

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

2626

2727
DO_NOT_VALIDATE = [

0 commit comments

Comments
 (0)