Updated and fixed cancel P2p transmission
testing/ogcore-api/pipeline/head This commit looks good Details

jenkins_upload_packages 0.9.1
Manuel Aranda Rosales 2025-03-12 09:05:04 +01:00
parent ece5763f0a
commit 94721d4371
1 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ use App\Entity\Image;
use App\Entity\ImageImageRepository;
use App\Entity\Trace;
use App\Model\CommandTypes;
use App\Model\DeployMethodTypes;
use App\Model\TraceStatus;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
@ -52,7 +53,11 @@ class CancelTransmissionAction extends AbstractOgRepositoryController
throw new ValidatorException('Fullsum is required');
}
$content = $this->createRequest('DELETE', 'http://'.$image->getRepository()->getIp().':8006/ogrepository/v1/'.$method.'/images/'.$image->getImageFullsum());
if ($method === DeployMethodTypes::TORRENT) {
$content = $this->createRequest('DELETE', 'http://'.$image->getRepository()->getIp().':8006/ogrepository/v1/p2p');
} else {
$content = $this->createRequest('DELETE', 'http://'.$image->getRepository()->getIp().':8006/ogrepository/v1/'.$method.'/images/'.$image->getImageFullsum());
}
if (isset($content['error']) && $content['error'] === Response::HTTP_INTERNAL_SERVER_ERROR ) {
throw new ValidatorException('Error cancelling transmission');