Skip to content

Commit 614344e

Browse files
committed
fix: invalidate cache when pre-generating charts
1 parent c5a4d89 commit 614344e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/handlers/points.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export const createScore = async function(prisma: PrismaClient, type: CodamCoali
8484
}
8585

8686
// Start caching updated charts, but don't wait for that to finish
87-
generateChartAllCoalitionScoreHistory(prisma);
88-
generateChartCoalitionScoreHistory(prisma, coalitionUser.coalition_id);
87+
generateChartAllCoalitionScoreHistory(prisma, true);
88+
generateChartCoalitionScoreHistory(prisma, coalitionUser.coalition_id, true);
8989

9090
return score;
9191
}
@@ -107,8 +107,8 @@ export const updateScore = async function(prisma: PrismaClient, score: CodamCoal
107107
await syncIntraScore(prisma, api, score, true);
108108

109109
// Start caching updated charts, but don't wait for that to finish
110-
generateChartAllCoalitionScoreHistory(prisma);
111-
generateChartCoalitionScoreHistory(prisma, score.coalition_id);
110+
generateChartAllCoalitionScoreHistory(prisma, true);
111+
generateChartCoalitionScoreHistory(prisma, score.coalition_id, true);
112112

113113
return await prisma.codamCoalitionScore.findFirstOrThrow({
114114
where: {
@@ -134,8 +134,8 @@ export const shiftScore = async function(prisma: PrismaClient, scoreId: number,
134134
await syncIntraScore(prisma, api, score, false); // Sync this score but not the total coalition score, as we often move many points at once when shifting scores. Better to sync the total score once at the end.
135135

136136
// Start caching updated charts, but don't wait for that to finish
137-
generateChartAllCoalitionScoreHistory(prisma);
138-
generateChartCoalitionScoreHistory(prisma, score.coalition_id);
137+
generateChartAllCoalitionScoreHistory(prisma, true);
138+
generateChartCoalitionScoreHistory(prisma, score.coalition_id, true);
139139

140140
return score;
141141
}

0 commit comments

Comments
 (0)