SysOps: deploy-all — 2026-06-09 10:59 UTC
This commit is contained in:
@@ -285,6 +285,18 @@ def collect_briefing_data() -> dict[str, Any]:
|
||||
except Exception:
|
||||
data["trending_food"] = []
|
||||
|
||||
if not data.get("trending_food"):
|
||||
try:
|
||||
data["trending_food"] = fetch_all(
|
||||
"""SELECT i.id, i.title, i.link, i.summary, f.name AS feed_name, f.url AS feed_url,
|
||||
f.category, i.published_at
|
||||
FROM rss_items i
|
||||
JOIN rss_feeds f ON f.id = i.feed_id AND f.is_active = TRUE
|
||||
ORDER BY i.published_at DESC NULLS LAST, i.fetched_at DESC LIMIT 12"""
|
||||
)
|
||||
except Exception:
|
||||
data["trending_food"] = []
|
||||
|
||||
try:
|
||||
data["food_market_highlights"] = fetch_all(
|
||||
"""SELECT i.title, i.link, i.summary, f.name AS feed_name, f.url AS feed_url, f.category
|
||||
@@ -296,6 +308,22 @@ def collect_briefing_data() -> dict[str, Any]:
|
||||
except Exception:
|
||||
data["food_market_highlights"] = []
|
||||
|
||||
if not data.get("food_market_highlights"):
|
||||
data["food_market_highlights"] = list(data.get("trending_food") or [])[:10]
|
||||
|
||||
try:
|
||||
data["rss_live"] = fetch_all(
|
||||
"""SELECT i.id, i.title, i.link, i.summary, f.name AS feed_name, f.url AS feed_url,
|
||||
f.category, i.published_at
|
||||
FROM rss_items i
|
||||
JOIN rss_feeds f ON f.id = i.feed_id AND f.is_active = TRUE
|
||||
ORDER BY i.published_at DESC NULLS LAST, i.fetched_at DESC LIMIT 25"""
|
||||
)
|
||||
except Exception:
|
||||
data["rss_live"] = list(data.get("trending_food") or [])
|
||||
|
||||
data["rss_items"] = _safe_count("rss_items")
|
||||
|
||||
data["activity_log"] = _build_activity_log(data)
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user