Bjornpool commited on
Commit
b3845fa
·
1 Parent(s): dc6cdb1

fix: cache wykresów, timeout 60s, pasek postępu źródeł

Browse files
TruthScan AI_backend/app/routes/news.py CHANGED
@@ -43,7 +43,7 @@ def get_news(source: str, lang: str = "pl", model: str = "roberta"):
43
  if not feed.entries:
44
  return {"source": source, "articles": []}
45
 
46
- MAX_ARTICLES = 5
47
  articles: List[dict] = []
48
 
49
  # Przetwarzanie i analiza artykułów
@@ -97,7 +97,7 @@ async def stream_news(source: str, lang: str = "pl", model: str = "roberta"):
97
  return
98
 
99
  entries = feed.entries or []
100
- MAX_ARTICLES = 5
101
  to_send = entries[:MAX_ARTICLES]
102
 
103
  # Metadane dla klienta
 
43
  if not feed.entries:
44
  return {"source": source, "articles": []}
45
 
46
+ MAX_ARTICLES = 3
47
  articles: List[dict] = []
48
 
49
  # Przetwarzanie i analiza artykułów
 
97
  return
98
 
99
  entries = feed.entries or []
100
+ MAX_ARTICLES = 3
101
  to_send = entries[:MAX_ARTICLES]
102
 
103
  # Metadane dla klienta
frontend/app/dashboard/components/ChartsSection.tsx CHANGED
@@ -71,12 +71,6 @@ export default function ChartsSection({
71
  const chartsSectionRef = useRef<HTMLDivElement | null>(null);
72
  const hasLoadedRef = useRef(false);
73
 
74
- console.log('[CACHE CHECK]', {
75
- cachedCharts: !!cachedCharts,
76
- cachedChartsData: cachedCharts ? Object.keys(cachedCharts) : null,
77
- hasLoadedRef: hasLoadedRef?.current
78
- });
79
-
80
  // ── Effective values ────────────────────────────────────────────────────────
81
  // Live dane z hooka (subskrypcja Zustand) mają priorytet nad starym cache z localStorage.
82
  // Dzięki temu zmiana artykułów (SSE/prefetch) natychmiast aktualizuje wykresy.
 
71
  const chartsSectionRef = useRef<HTMLDivElement | null>(null);
72
  const hasLoadedRef = useRef(false);
73
 
 
 
 
 
 
 
74
  // ── Effective values ────────────────────────────────────────────────────────
75
  // Live dane z hooka (subskrypcja Zustand) mają priorytet nad starym cache z localStorage.
76
  // Dzięki temu zmiana artykułów (SSE/prefetch) natychmiast aktualizuje wykresy.
start_frontend.bat ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ @echo off
2
+ cd /d "%~dp0frontend"
3
+ npm run dev
4
+ pause