Skip to content

Commit f2daf93

Browse files
committed
comment why this one is correct
1 parent 8ba75e0 commit f2daf93

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

adabot/github_requests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ def request(method, url, **kwargs):
9292
logging.warning(
9393
"GitHub API Rate Limit reached. Pausing until Rate Limit reset."
9494
)
95+
# This datetime.now() is correct, *because* `fromtimestamp` above
96+
# converts the timestamp into local time, same as now(). This is
97+
# different than the sites that use GH_INTERFACE.get_rate_limit, in
98+
# which the rate limit is a UTC time, so it has to be compared to
99+
# utcnow.
95100
while datetime.datetime.now() < rate_limit_reset:
96101
logging.warning("Rate Limit will reset at: %s", rate_limit_reset)
97102
reset_diff = rate_limit_reset - datetime.datetime.now()

0 commit comments

Comments
 (0)