From 88753273e1186afe047a490ae74e44235fdc37d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Mon, 30 Dec 2024 17:40:52 +0100 Subject: [PATCH] fix: begin transaction before update domain --- src/Service/RDAPService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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())) {