feat: use RDAP bootstrap file publication date

This commit is contained in:
Maël Gangloff 2024-08-19 18:38:14 +02:00
parent 0b0d4257da
commit f3eb055545
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629

View File

@ -438,19 +438,7 @@ readonly class RDAPService
/**
* @throws ORMException
*/
public function updateRDAPServersFromFile(string $fileName): void
{
if (!file_exists($fileName)) {
return;
}
$this->logger->info('Start of update the RDAP server list from custom config file.');
$this->updateRDAPServers(Yaml::parseFile($fileName));
}
/**
* @throws ORMException
* @throws \Exception
*/
private function updateRDAPServers(array $dnsRoot): void
{
@ -465,7 +453,10 @@ readonly class RDAPService
if (null === $server) {
$server = new RdapServer();
}
$server->setTld($tldReference)->setUrl($rdapServerUrl)->updateTimestamps();
$server
->setTld($tldReference)
->setUrl($rdapServerUrl)
->setUpdatedAt(new \DateTimeImmutable(array_key_exists('publication', $dnsRoot) ? $dnsRoot['publication'] : 'now'));
$this->em->persist($server);
}
@ -474,6 +465,19 @@ readonly class RDAPService
$this->em->flush();
}
/**
* @throws ORMException
*/
public function updateRDAPServersFromFile(string $fileName): void
{
if (!file_exists($fileName)) {
return;
}
$this->logger->info('Start of update the RDAP server list from custom config file.');
$this->updateRDAPServers(Yaml::parseFile($fileName));
}
/**
* @throws TransportExceptionInterface
* @throws ServerExceptionInterface