diff --git a/src/Service/RDAPService.php b/src/Service/RDAPService.php index dadd1a3..1e28da1 100644 --- a/src/Service/RDAPService.php +++ b/src/Service/RDAPService.php @@ -137,15 +137,15 @@ readonly class RDAPService $rdapServer = $this->fetchRdapServer($tld); $domain = $this->domainRepository->findOneBy(['ldhName' => $idnDomain]); - $this->em->beginTransaction(); - $this->em->lock($domain, LockMode::PESSIMISTIC_WRITE); - $rdapData = $this->fetchRdapResponse($rdapServer, $idnDomain, $domain); if (null === $domain) { $domain = $this->initNewDomain($idnDomain, $tld); } + $this->em->beginTransaction(); + $this->em->lock($domain, LockMode::PESSIMISTIC_WRITE); + $this->updateDomainStatus($domain, $rdapData); if (in_array('free', $domain->getStatus())) {