Update app.py
Browse files
app.py
CHANGED
|
@@ -52,7 +52,7 @@ def search_full_plant_information(plant_name:str):
|
|
| 52 |
for attempt in range(3): # Retry up to 3 times
|
| 53 |
try:
|
| 54 |
search_results = DDGS().text(keywords=query, max_results=5)
|
| 55 |
-
except
|
| 56 |
if "Ratelimit" in str(e):
|
| 57 |
try:
|
| 58 |
wait_time = 2 ** attempt # Exponential backoff
|
|
|
|
| 52 |
for attempt in range(3): # Retry up to 3 times
|
| 53 |
try:
|
| 54 |
search_results = DDGS().text(keywords=query, max_results=5)
|
| 55 |
+
except Exception as e:
|
| 56 |
if "Ratelimit" in str(e):
|
| 57 |
try:
|
| 58 |
wait_time = 2 ** attempt # Exponential backoff
|