fix: begin transaction before update domain

This commit is contained in:
Maël Gangloff
2024-12-30 17:44:38 +01:00
parent 88753273e1
commit ebfcc58d16

View File

@@ -138,12 +138,13 @@ readonly class RDAPService
$domain = $this->domainRepository->findOneBy(['ldhName' => $idnDomain]);
$rdapData = $this->fetchRdapResponse($rdapServer, $idnDomain, $domain);
$this->em->beginTransaction();
if (null === $domain) {
$domain = $this->initNewDomain($idnDomain, $tld);
$this->em->persist($domain);
}
$this->em->beginTransaction();
$this->em->lock($domain, LockMode::PESSIMISTIC_WRITE);
$this->updateDomainStatus($domain, $rdapData);