fix: 修复安徽日报出现局部变量t未定义

This commit is contained in:
皓月归尘 2024-11-12 13:27:35 +08:00
parent 9bc73843fa
commit 5767dfb591

View File

@ -76,6 +76,7 @@ async def getData(start_date: datetime, end_date: datetime):
try: try:
async with AsyncClient(headers=headers, timeout=60, http2=False) as client: async with AsyncClient(headers=headers, timeout=60, http2=False) as client:
print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), url) print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), url)
for t in range(5):
try: try:
response = await client.get(url) response = await client.get(url)
except Exception as e: except Exception as e: