File tree Expand file tree Collapse file tree 2 files changed +29
-8
lines changed Expand file tree Collapse file tree 2 files changed +29
-8
lines changed Original file line number Diff line number Diff line change @@ -187,16 +187,30 @@ async function addContestTaskPairs() {
187187 for ( const pair of contest_task_pairs ) {
188188 contestTaskPairQueue . add ( async ( ) => {
189189 try {
190- const registeredPair = await prisma . contestTaskPair . findUnique ( {
191- where : {
192- contestId_taskId : {
193- contestId : pair . contest_id ,
194- taskId : pair . problem_id ,
190+ const [ registeredPair , registeredTask ] = await Promise . all ( [
191+ prisma . contestTaskPair . findUnique ( {
192+ where : {
193+ contestId_taskId : {
194+ contestId : pair . contest_id ,
195+ taskId : pair . problem_id ,
196+ } ,
195197 } ,
196- } ,
197- } ) ;
198+ } ) ,
199+ prisma . task . findUnique ( {
200+ where : { task_id : pair . problem_id } ,
201+ } ) ,
202+ ] ) ;
198203
199- if ( ! registeredPair ) {
204+ if ( ! registeredTask ) {
205+ console . warn (
206+ 'Skipped contest task pair due to missing task:' ,
207+ pair . problem_id ,
208+ 'for contest' ,
209+ pair . contest_id ,
210+ 'index' ,
211+ pair . problem_index ,
212+ ) ;
213+ } else if ( ! registeredPair ) {
200214 await addContestTaskPair ( pair , contestTaskPairFactory ) ;
201215 console . log (
202216 'contest_id:' ,
Original file line number Diff line number Diff line change @@ -5296,6 +5296,13 @@ export const tasks = [
52965296 title : '078. Easy Graph Problem(★2)' ,
52975297 grade : 'Q5' ,
52985298 } ,
5299+ {
5300+ id : 'typical90_s' ,
5301+ contest_id : 'typical90' ,
5302+ problem_index : '019' ,
5303+ name : 'Pick Two(★6)' ,
5304+ title : '019. Pick Two(★6)' ,
5305+ } ,
52995306 {
53005307 id : 'typical90_n' ,
53015308 contest_id : 'typical90' ,
You can’t perform that action at this time.
0 commit comments