Add countdown

This commit is contained in:
agatha 2023-11-10 22:46:18 -05:00
parent a15b5ffda0
commit 5c4fb60ff2

View File

@ -56,8 +56,7 @@ class GitHubApi:
"""Parse headers to update rate limits.""" """Parse headers to update rate limits."""
self.rate_reset = datetime.fromtimestamp(int(headers['x-ratelimit-reset'])) self.rate_reset = datetime.fromtimestamp(int(headers['x-ratelimit-reset']))
self.rate_remaining = int(headers['x-ratelimit-remaining']) self.rate_remaining = int(headers['x-ratelimit-remaining'])
logger.info(f'{self.rate_remaining} calls remaining until {self.rate_reset}') logger.info(f'{self.rate_remaining} calls remaining until {self.rate_reset} ({self.rate_reset - datetime.now()})')
def get_events(self, page=None): def get_events(self, page=None):
"""Fetch GitHub events.""" """Fetch GitHub events."""