reduce traffic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
import { fetchMatchesAndTeamsFifa, fetchOdds, attachOdds, attachKOOdds, fetchFifaScores, applyFifaScores, attachFifaGoals } from "@/lib/feeds";
|
||||
import { fetchMatchesAndTeamsFifa, fetchOdds, attachOdds, attachKOOdds, attachFifaLiveData } from "@/lib/feeds";
|
||||
import { computeGroupTables, computeThirdPlaceTable } from "@/lib/standings";
|
||||
import { qualifiedThirdGroups, resolveAnnexC } from "@/lib/bracket";
|
||||
import { securelyQualifiedThirdTeams } from "@/lib/third-place-security";
|
||||
@@ -27,17 +27,11 @@ export async function GET(request: NextRequest) {
|
||||
matches = attachKOOdds(matches, teams, odds);
|
||||
}
|
||||
|
||||
// FIFA-Live-Scores als häufiger gecachtes Overlay
|
||||
// FIFA-Live-Scores als häufiger gecachtes Overlay (Pipeline: Scores → Goals)
|
||||
try {
|
||||
const fifaData = await fetchFifaScores(locale);
|
||||
matches = applyFifaScores(matches, teams, fifaData);
|
||||
try {
|
||||
matches = await attachFifaGoals(matches, fifaData, locale);
|
||||
} catch (err) {
|
||||
console.warn("[fifa] Goals fehlgeschlagen:", err instanceof Error ? err.message : err);
|
||||
}
|
||||
matches = await attachFifaLiveData(matches, teams, locale);
|
||||
} catch (err) {
|
||||
console.warn("[fifa] Scores fehlgeschlagen:", err instanceof Error ? err.message : err);
|
||||
console.warn("[fifa] Live-Overlay fehlgeschlagen:", err instanceof Error ? err.message : err);
|
||||
}
|
||||
|
||||
const groupTables = computeGroupTables(teams, matches);
|
||||
|
||||
Reference in New Issue
Block a user