Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -294,7 +294,18 @@ if research_button and topic:
|
|
| 294 |
|
| 295 |
return sources
|
| 296 |
|
| 297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
merged = merge_duplicates(all_sources)
|
| 299 |
merged = sort_sources_chronologically(merged)
|
| 300 |
|
|
|
|
| 294 |
|
| 295 |
return sources
|
| 296 |
|
| 297 |
+
|
| 298 |
+
all_sources, retries = [], 0
|
| 299 |
+
while retries < 3:
|
| 300 |
+
all_sources = fetch_all_sources()
|
| 301 |
+
if all_sources:
|
| 302 |
+
break
|
| 303 |
+
retries += 1
|
| 304 |
+
time.sleep(2)
|
| 305 |
+
|
| 306 |
+
if not all_sources:
|
| 307 |
+
raise ValueError("❌ No sources found.")
|
| 308 |
+
|
| 309 |
merged = merge_duplicates(all_sources)
|
| 310 |
merged = sort_sources_chronologically(merged)
|
| 311 |
|