Remove HTTP 304 checks

This commit is contained in:
agatha 2023-11-11 13:55:31 -05:00
parent 5a4960a087
commit 74288909ba

View File

@ -33,7 +33,7 @@ class GitHubApi:
"""GET an HTTP resource and return JSON."""
url = self.base_url + endpoint
# Check rate limits
# Check rate limits and sleep if exceeded
if self.rate_remaining == 0 and self.rate_reset > datetime.now():
logger.warning(f'Out of API calls. Sleeping until {self.rate_reset}.')
delta = self.rate_reset - datetime.now()
@ -45,10 +45,6 @@ class GitHubApi:
logger.warning(f'Failed to execute GET request: {str(e)}')
return None
# 304 Not Modified
if response.status_code == '304':
return None
self.__parse_headers(response.headers)
return response.json()