Skip to content

Commit

Permalink
fix: begin transaction before update domain
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed Dec 30, 2024
1 parent 8875327 commit ebfcc58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Service/RDAPService.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ public function registerDomain(string $fqdn): Domain
$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);
Expand Down

0 comments on commit ebfcc58

Please sign in to comment.