@@ -914,28 +914,15 @@ protected function giveBackJudging(int $judgingId, ?Judgehost $judgehost): void
914
914
if ($ judging ) {
915
915
$ q = $ this ->em ->createQueryBuilder ()
916
916
->update (JudgingRun::class, 'jr ' )
917
- ->join (JudgeTask::class , 'jt ' )
917
+ ->join (' jr.judgetask ' , 'jt ' )
918
918
->andWhere ('jr.runresult IS NOT NULL ' )
919
919
->andWhere ('jr.judgingid = :judgingid ' )
920
920
->setParameter ('judgingid ' , $ judgingId );
921
921
922
922
if ($ judgehost === null ) {
923
923
// This is coming from internal errors, reset the whole judging.
924
- $ q ->set ('jt.valid ' , 0 );
925
- } else {
926
- $ q ->andWhere ('jr.run_result IS NOT NULL ' )
927
- ->join (JudgeHost::class, 'jh ' )
928
- ->set ('jt.judgehostid ' , ':judgehostid ' )
929
- ->set ('jt.starttime ' , ':starttime ' )
930
- ->setParameter ('judgehostid ' , null )
931
- ->setParameter ('starttime ' , null )
932
- ->andWhere ('jh.hostname = :judgehost ' )
933
- ->setParameter ('judgehost ' , $ judgehost ->getHostname ());
934
- }
935
-
936
- $ q ->getQuery ()->execute ();
924
+ $ q ->set ('jt.valid ' , 0 )->getQuery ()->execute ();
937
925
938
- if ($ judgehost === null ) {
939
926
// Invalidate old judging and create a new one - but without judgetasks yet since this was triggered by
940
927
// an internal error.
941
928
$ judging ->setValid (false );
@@ -947,6 +934,16 @@ protected function giveBackJudging(int $judgingId, ?Judgehost $judgehost): void
947
934
->setOriginalJudging ($ judging );
948
935
$ this ->em ->persist ($ newJudging );
949
936
$ this ->em ->flush ();
937
+ } else {
938
+ $ q ->andWhere ('jr.run_result IS NOT NULL ' )
939
+ ->join ('jt.judgehost ' , 'jh ' )
940
+ ->set ('jt.judgehostid ' , ':judgehostid ' )
941
+ ->set ('jt.starttime ' , ':starttime ' )
942
+ ->setParameter ('judgehostid ' , null )
943
+ ->setParameter ('starttime ' , null )
944
+ ->andWhere ('jh.hostname = :judgehost ' )
945
+ ->setParameter ('judgehost ' , $ judgehost ->getHostname ())
946
+ ->getQuery ()->execute ();
950
947
}
951
948
952
949
$ this ->dj ->auditlog ('judging ' , $ judgingId , 'given back '
0 commit comments