1
0
mirror of https://gitlab.com/simple-stock-bots/simple-stock-bot.git synced 2026-06-04 05:10:25 +00:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Anson dd8b4f0d04 finish renaming 2023-10-17 05:37:26 +00:00
Anson 533e4fa7d1 more renaming 2023-10-17 05:36:44 +00:00
Anson 0b99c4435d see if renaming to pages fixes ci 2023-10-17 05:35:37 +00:00
-8
View File
@@ -9,8 +9,6 @@ from markdownify import markdownify
from common.Symbol import Coin from common.Symbol import Coin
from common.utilities import rate_limited from common.utilities import rate_limited
import time
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@@ -36,12 +34,6 @@ class cg_Crypto:
url = "https://api.coingecko.com/api/v3" + endpoint url = "https://api.coingecko.com/api/v3" + endpoint
resp = r.get(url, params=params, timeout=timeout) resp = r.get(url, params=params, timeout=timeout)
# Make sure API returned a proper status code # Make sure API returned a proper status code
if resp.status_code == 429:
log.warning(f"CoinGecko returned 429 - Too Many Requests for endpoint: {endpoint}. Sleeping and trying again.")
time.sleep(10)
return self.get(endpoint=endpoint, params=params, timeout=timeout)
try: try:
resp.raise_for_status() resp.raise_for_status()
except r.exceptions.HTTPError as e: except r.exceptions.HTTPError as e: