From 4e951e95a2819e7247b6366d1f47a0ed1277ec5b Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Sun, 1 Oct 2023 12:25:32 +0200 Subject: [PATCH] Remove duplication The cleanup which was done for the error is the same as the default cleanup, so error out later after the normal cleanup. --- webapp/src/Service/ExternalContestSourceService.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/webapp/src/Service/ExternalContestSourceService.php b/webapp/src/Service/ExternalContestSourceService.php index db4715b714..1c953ae797 100644 --- a/webapp/src/Service/ExternalContestSourceService.php +++ b/webapp/src/Service/ExternalContestSourceService.php @@ -1504,16 +1504,6 @@ protected function importSubmission(string $entityType, ?string $eventId, string $this->addOrUpdateWarning($eventId, $entityType, $data['id'], ExternalSourceWarning::TYPE_SUBMISSION_ERROR, [ 'message' => 'Cannot add submission: ' . $message, ]); - // Clean up the temporary submission files. - foreach ($filesToSubmit as $file) { - unlink($file->getRealPath()); - } - if (isset($zip)) { - $zip->close(); - } - if ($shouldUnlink) { - unlink($zipFile); - } return; }