Add discovery search history with auto-save, fix timeout causing search failure

- Save every search result to DB for later review
- Add '搜索历史' tab with timeline view, load/delete records
- Raise discovery search timeout from 30s to 120s (Bing Puppeteer needs ~40s)
- Reduce search queries from 4 to 3 for faster response
- New model: DiscoveryRecord (user_id, product, market, companies JSON)
- API: POST/GET/DELETE /api/v1/discovery/records
- Migration: discovery_records table
This commit is contained in:
TradeMate Dev
2026-05-27 15:54:50 +08:00
parent 6f0d8b0fb4
commit c1638db6b2
8 changed files with 308 additions and 10 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ URL: {company_url}
async def _web_search_all(self, queries: list) -> dict:
try:
results = await search_bing_batch(queries[:4], max_per_query=5)
results = await search_bing_batch(queries[:3], max_per_query=4)
if results:
return {"results": self._dedup_and_filter(results)[:15], "provider": "bing"}
except Exception as e: