fix: intensify on last day

This commit is contained in:
Maël Gangloff
2025-04-06 15:25:38 +02:00
parent 2a47d351b8
commit c940fba01a
5 changed files with 10 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ class RegisterDomainCommand extends Command
try {
if (null !== $domain && !$force) {
if (!$domain->isToBeUpdated()) {
if (!$domain->isToBeUpdated(true, true)) {
$io->warning('The domain name is already present in the database and does not need to be updated at this time.');
return Command::SUCCESS;

View File

@@ -54,7 +54,7 @@ class DomainRefreshController extends AbstractController
// If the domain name exists in the database, recently updated and not important, we return the stored Domain
if (null !== $domain
&& !$domain->getDeleted()
&& !$domain->isToBeUpdated()
&& !$domain->isToBeUpdated(true, true)
&& !$this->kernel->isDebug()
&& true !== filter_var($request->get('forced', false), FILTER_VALIDATE_BOOLEAN)
) {

View File

@@ -379,7 +379,7 @@ class Domain
*
* @throws \Exception
*/
public function isToBeUpdated(bool $fromUser = true): bool
public function isToBeUpdated(bool $fromUser = true, bool $intensifyLastDay = false): bool
{
$updatedAtDiff = $this->getUpdatedAt()->diff(new \DateTimeImmutable());
@@ -393,7 +393,7 @@ class Domain
$expiresIn = $this->getExpiresInDays();
if (0 === $expiresIn || 1 === $expiresIn) {
if ($intensifyLastDay && (0 === $expiresIn || 1 === $expiresIn)) {
return true;
}

View File

@@ -92,7 +92,7 @@ final readonly class UpdateDomainsFromWatchlistHandler
*/
/** @var Domain $domain */
foreach ($watchList->getDomains()->filter(fn ($domain) => $domain->isToBeUpdated(false)) as $domain
foreach ($watchList->getDomains()->filter(fn ($domain) => $domain->isToBeUpdated(false, null !== $watchList->getConnector())) as $domain
) {
$updatedAt = $domain->getUpdatedAt();