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={[{ dataSource={[{
domains: watchlist.domains.map(d => <Tag domains: watchlist.domains.map(d => <Tag
color={ 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('redemption period') ? 'yellow' :
d.status.includes('pending delete') ? 'volcano' : 'default' d.status.includes('pending delete') ? 'volcano' : 'default'
} }

View File

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