File tree Expand file tree Collapse file tree 1 file changed +23
-9
lines changed
docs/dev-notes/2025-10-22/add-contest-task-pairs-to-seeds Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -89,16 +89,30 @@ async function addContestTaskPairs() {
8989 for (const pair of contest_task_pairs ) {
9090 contestTaskPairQueue .add (async () => {
9191 try {
92- const registeredPair = await prisma .contestTaskPair .findUnique ({
93- where: {
94- contest_id_task_id: {
95- contest_id: pair .contest_id ,
96- task_id: pair .task_id ,
92+ const [registeredPair, registeredTask] = await Promise .all ([
93+ prisma .contestTaskPair .findUnique ({
94+ where: {
95+ contestId_taskId: {
96+ contestId: pair .contest_id ,
97+ taskId: pair .problem_id ,
98+ },
9799 },
98- },
99- });
100-
101- if (! registeredPair ) {
100+ }),
101+ prisma .task .findUnique ({
102+ where: { task_id: pair .problem_id },
103+ }),
104+ ]);
105+
106+ if (! registeredTask ) {
107+ console .warn (
108+ ' Skipped contest task pair due to missing task:' ,
109+ pair .problem_id ,
110+ ' for contest' ,
111+ pair .contest_id ,
112+ ' index' ,
113+ pair .problem_index ,
114+ );
115+ } else if (! registeredPair ) {
102116 await addContestTaskPair (pair , contestTaskPairFactory );
103117 console .log (
104118 ' contest_id:' ,
You can’t perform that action at this time.
0 commit comments