feat: update weekly if removed from WHOIS

This commit is contained in:
Maël Gangloff
2024-12-18 22:53:26 +01:00
parent ba90595d7b
commit 1b3e5c5ef8
2 changed files with 16 additions and 9 deletions

View File

@@ -80,7 +80,7 @@ export function WatchlistCard({watchlist, onUpdateWatchlist, connectors, onDelet
dataSource={[{
domains: watchlist.domains.map(d => <Tag
color={
d.deleted ? 'red' : // If the domain is deleted
d.deleted ? 'magenta' : // If the domain is deleted
d.status.includes('redemption period') ? 'yellow' :
d.status.includes('pending delete') ? 'volcano' : 'default'
}

View File

@@ -372,15 +372,22 @@ class Domain
*/
public function isToBeUpdated(bool $fromUser = true): bool
{
return $this->getUpdatedAt()
->diff(new \DateTimeImmutable())->days >= 7
|| (($fromUser || ($this->getUpdatedAt()
return $this->getUpdatedAt()->diff(new \DateTimeImmutable())->days >= 7
|| $this->getDeleted()
? $fromUser
: (
($fromUser || ($this->getUpdatedAt()
->diff(new \DateTimeImmutable())->h * 60 + $this->getUpdatedAt()
->diff(new \DateTimeImmutable())->i) >= 50)
&& $this->isToBeWatchClosely())
|| (count(array_intersect($this->getStatus(), ['auto renew period', 'client hold', 'server hold'])) > 0
&& $this->getUpdatedAt()->diff(new \DateTimeImmutable())->days >= 1);
->diff(new \DateTimeImmutable())->i) >= 50
)
&& $this->isToBeWatchClosely()
)
|| (
false == $this->getDeleted() && (
count(array_intersect($this->getStatus(), ['auto renew period', 'client hold', 'server hold'])) > 0
&& $this->getUpdatedAt()->diff(new \DateTimeImmutable())->days >= 1
)
);
}
/**