From 96adb62ce1ab2f75d2b3f51ccad5ae69604c340b Mon Sep 17 00:00:00 2001 From: Michael Yick Date: Mon, 27 Feb 2023 17:50:41 -0600 Subject: main.py is now more reasonable with retries --- main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 4e2ce3f..2293634 100755 --- a/main.py +++ b/main.py @@ -3,7 +3,6 @@ import requests from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry import bs4 -import time import feedgenerator from datetime import datetime, timedelta from fastapi import FastAPI, Response @@ -24,7 +23,7 @@ async def root(): date = rawDate.strftime('%Y-%m-%d') session = requests.Session() - retry = Retry(connect=3, backoff_factor=0.5) + retry = Retry(connect=10, backoff_factor=0.5) adapter = HTTPAdapter(max_retries=retry) session.mount('http://', adapter) session.mount('https://', adapter) -- cgit v1.2.3