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