From ebfcc58d160518983fec2f844f3efa61390f89d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Mon, 30 Dec 2024 17:44:38 +0100 Subject: [PATCH] fix: begin transaction before update domain --- src/Service/RDAPService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Service/RDAPService.php b/src/Service/RDAPService.php index 1e28da1..4353882 100644 --- a/src/Service/RDAPService.php +++ b/src/Service/RDAPService.php @@ -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);