fix(sports): stop a not-yet-published Liga squad re-read from the error hub
Liga 400s team/squad until it publishes a team's season list (newly promoted or still pre-season), same shape already fixed for importLigaSquads and backfillLigaRegister in BIT-31672 (c864a48). The on-the-spot re-read in syncEventSquadsNow (added later,f5fb4bb) still logged every failure at warn, and the pino->error-hub hook forwards any warn carrying an `err` — so a routine early read of the event's squads reached the hub (ERRCLUSTER 5b8e55fcfd43). Distinguish a 400 (not published yet, read again next refresh) from a real failure here too: info instead of warn for the former. Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8) Paperclip-Issue: BIT-32086 Paperclip-Run: 85fc6c83-a04d-40ad-a5ea-55e9719e33e7
This commit is contained in:
1 parent
837e3d70dc
commit
fc62f2a327
1 file changed
+4
-1
@@ -1458,7 +1458,10 @@ export class SportsService {
|
||||
try {
|
||||
await this.savePlayers(team.id, season, await this.liga.squad(team.externalId, season), "api");
|
||||
} catch (err) {
|
||||
log.warn({ err, team: team.id }, "sports: liga squad re-read failed");
|
||||
// Same not-yet-published 400 as importLigaSquads/backfillLigaRegister: expected, kept out of the error hub.
|
||||
if (err instanceof ProviderHttpError && err.status === 400)
|
||||
log.info({ err, team: team.id }, "sports: liga squad not published yet for this team");
|
||||
else log.warn({ err, team: team.id }, "sports: liga squad re-read failed");
|
||||
}
|
||||
}
|
||||
for (const team of [event.homeTeam, event.awayTeam]) {
|
||||
|
||||
Reference in new issue
Block a user