From 74288909bad67bc0a16bbd96c264b963fdf8d6c6 Mon Sep 17 00:00:00 2001 From: agatha Date: Sat, 11 Nov 2023 13:55:31 -0500 Subject: [PATCH] Remove HTTP 304 checks --- gitmon/api.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gitmon/api.py b/gitmon/api.py index 29fe759..1c78d80 100644 --- a/gitmon/api.py +++ b/gitmon/api.py @@ -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()