fix: dispatch DetectDomainChange if registerDomain is successful

This commit is contained in:
Maël Gangloff 2025-10-28 13:24:16 +01:00
parent b77dca9f62
commit fb726ac88a
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629

View File

@ -96,6 +96,11 @@ final readonly class UpdateDomainHandler
* We send messages that correspond to the sending of notifications that will not be processed here.
*/
$this->RDAPService->registerDomain($domain->getLdhName());
/** @var Watchlist $wl */
foreach ($domain->getWatchlists()->getIterator() as $wl) {
$this->bus->dispatch(new DetectDomainChange($wl->getToken(), $domain->getLdhName(), $updatedAt));
}
} catch (DomainNotFoundException) {
$newDomain = $this->domainRepository->findOneBy(['ldhName' => $domain->getLdhName()]);
@ -117,10 +122,5 @@ final readonly class UpdateDomainHandler
* In this case, the domain name can no longer be updated. Unfortunately, there is nothing more that can be done.
*/
}
/** @var Watchlist $wl */
foreach ($domain->getWatchlists()->getIterator() as $wl) {
$this->bus->dispatch(new DetectDomainChange($wl->getToken(), $domain->getLdhName(), $updatedAt));
}
}
}