feat(import): add daily click-tt league table import by season
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 2m39s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been skipped

This commit is contained in:
Torsten Schulz (local)
2026-05-20 17:28:07 +02:00
parent 3658589d94
commit 21b39d4e5c
3 changed files with 241 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import { importSpielplan } from '../utils/spielplan-import.js'
import { importLeagueTables } from '../utils/spielklassen-tables-import.js'
import { info as loggerInfo, error as loggerError } from '../utils/logger.js'
const TIME_ZONE = 'Europe/Berlin'
@@ -68,8 +69,19 @@ async function runImport(reason) {
running = true
try {
const result = await importSpielplan()
loggerInfo(`[spielplan-import] ${reason}: ${result.matchCount} Spiele importiert`, { range: `${result.source.season.dateStart} - ${result.source.season.dateEnd}` })
const spielplan = await importSpielplan()
loggerInfo(`[spielplan-import] ${reason}: ${spielplan.matchCount} Spiele importiert`, { range: `${spielplan.source.season.dateStart} - ${spielplan.source.season.dateEnd}` })
try {
const tables = await importLeagueTables()
loggerInfo(`[spielplan-import] ${reason}: ${tables.importedCount}/${tables.teamCount} Tabellen importiert`, {
season: tables.seasonSlug,
outputFile: tables.outputFile,
errors: tables.errorCount
})
} catch (error) {
loggerError('[spielplan-import] Tabellen-Import fehlgeschlagen:', { error })
}
} catch (error) {
loggerError('[spielplan-import] Import fehlgeschlagen:', { error })
} finally {