Remove redundant processPlayoffEvent loop from finalize-bracket action
All bracket rounds are already processed (with scoring and Discord notifications) as each match winner is set via set-winner/set-round-winners. By the time the Finalize button is clicked, placements are current and standings are up to date. The re-processing loop was firing recalculations and Discord notifications once per round needlessly. The finalize action now only assigns 0 points to non-bracket participants, marks the event complete, and runs one final standings recalculation. https://claude.ai/code/session_01RhQS6FQRh6iYtVNaryCEf5
This commit is contained in:
parent
a71e256bfd
commit
5e88853260
1 changed files with 0 additions and 13 deletions
|
|
@ -712,20 +712,7 @@ export async function action({ request, params }: Route.ActionArgs) {
|
||||||
matches.flatMap((m) => [m.participant1Id, m.participant2Id].filter(Boolean))
|
matches.flatMap((m) => [m.participant1Id, m.participant2Id].filter(Boolean))
|
||||||
);
|
);
|
||||||
|
|
||||||
// Process all rounds in order
|
|
||||||
const db = database();
|
const db = database();
|
||||||
for (const round of template.rounds) {
|
|
||||||
const roundMatches = matches.filter((m) => m.round === round.name);
|
|
||||||
if (roundMatches.length === 0) continue;
|
|
||||||
|
|
||||||
// Set playoffRound and process this round
|
|
||||||
await db
|
|
||||||
.update(schema.scoringEvents)
|
|
||||||
.set({ playoffRound: round.name, updatedAt: new Date() })
|
|
||||||
.where(eq(schema.scoringEvents.id, params.eventId));
|
|
||||||
|
|
||||||
await processPlayoffEvent(params.eventId, db);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assign 0 points to participants not in the bracket (Q20)
|
// Assign 0 points to participants not in the bracket (Q20)
|
||||||
for (const participant of allParticipants) {
|
for (const participant of allParticipants) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue