Skip to content

Commit 92b1189

Browse files
authored
Print out more ratelimit info. (#158)
1 parent 07b9737 commit 92b1189

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

miss_islington/__main__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ async def main(request):
3838
# Give GitHub some time to reach internal consistency.
3939
await asyncio.sleep(1)
4040
await router.dispatch(event, gh)
41-
try:
42-
print(f"GH requests remaining: {gh.rate_limit.remaining}")
43-
except AttributeError:
44-
pass
41+
try:
42+
print(
43+
f"GH requests remaining: {gh.rate_limit.remaining}/{gh.rate_limit.limit}, reset time: {gh.rate_limit.reset_datetime:%b-%d-%Y %H:%M:%S %Z}"
44+
)
45+
except AttributeError:
46+
pass
4547
return web.Response(status=200)
4648
except Exception as exc:
4749
traceback.print_exc(file=sys.stderr)

0 commit comments

Comments
 (0)