rm logs + caching
This commit is contained in:
@@ -27,37 +27,18 @@ export async function GET() {
|
||||
const liveScores = await fetchLiveScores();
|
||||
matches = applyLiveScores(matches, teams, liveScores);
|
||||
} catch (err) {
|
||||
console.error("[worldcup26] fetchLiveScores fehlgeschlagen:", err);
|
||||
console.warn("[worldcup26] fetchLiveScores fehlgeschlagen:", err instanceof Error ? err.message : err);
|
||||
}
|
||||
|
||||
const groupTables = computeGroupTables(teams, matches);
|
||||
const groupTablesLive = computeGroupTables(teams, matches, true);
|
||||
|
||||
// K.o.-Match-Nummern per Slot-Auflösung vergeben (FIFA-Topologie)
|
||||
assignKONumbersBySlots(matches, teams);
|
||||
|
||||
// Zweiter Durchlauf: Polymarket-Odds auf K.o.-Matches mit aufgelöster R32-Paarung
|
||||
console.log("[ROUTE] vor attachKOOdds | odds vorhanden:", !!odds, "| odds länge:", odds?.length);
|
||||
if (odds) {
|
||||
try {
|
||||
matches = attachKOOdds(matches, teams, odds);
|
||||
console.log("[ROUTE] nach attachKOOdds | matches länge:", matches?.length);
|
||||
} catch (err) {
|
||||
console.error("[ROUTE] attachKOOdds fehlgeschlagen:", err);
|
||||
}
|
||||
matches = attachKOOdds(matches, teams, odds);
|
||||
}
|
||||
|
||||
console.log("[ROUTE] vor PM-SNAPSHOT | matches länge:", matches?.length);
|
||||
const withProb = matches.filter(m => m.prob != null);
|
||||
console.log("[PM-SNAPSHOT]", new Date().toISOString(),
|
||||
"| anzahl mit prob:", withProb.length,
|
||||
"| spiele:", withProb.map(m => {
|
||||
const h = teams.find(t=>t.id===m.homeTeamId)?.code;
|
||||
const a = teams.find(t=>t.id===m.awayTeamId)?.code;
|
||||
return `${h}-${a}`;
|
||||
}).join(", "));
|
||||
|
||||
// prob-Feld normalisieren: immer null statt undefined, damit JSON konsistent ist
|
||||
const normalizedMatches = matches.map((m) => ({ ...m, prob: m.prob ?? null }));
|
||||
|
||||
const thirdTable = computeThirdPlaceTable(groupTablesLive);
|
||||
|
||||
Reference in New Issue
Block a user