fix: set updatedAt when a deleted domain is queried

This commit is contained in:
Maël Gangloff 2024-07-25 19:04:59 +02:00
parent f9a41c3954
commit d153d3af78
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629
2 changed files with 10 additions and 5 deletions

View File

@ -15,6 +15,9 @@ use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Messenger\Exception\ExceptionInterface;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\RateLimiter\RateLimiterFactory;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
class DomainRefreshController extends AbstractController
{
@ -27,8 +30,11 @@ class DomainRefreshController extends AbstractController
}
/**
* @throws Exception
* @throws TransportExceptionInterface
* @throws HttpExceptionInterface
* @throws DecodingExceptionInterface
* @throws ExceptionInterface
* @throws Exception
*/
public function __invoke(string $ldhName, KernelInterface $kernel): ?Domain
{

View File

@ -126,11 +126,10 @@ readonly class RDAPService
)->toArray();
} catch (HttpExceptionInterface $e) {
if ($domain !== null) {
$domain->setDeleted(true);
$domain->setDeleted(true)
->updateTimestamps();
$this->em->persist($domain);
$this->em->flush();
return $domain;
}
throw $e;
}