diff --git a/app/Services/Cloudflare/ZoneService.php b/app/Services/Cloudflare/ZoneService.php index b13b20a..286a42a 100644 --- a/app/Services/Cloudflare/ZoneService.php +++ b/app/Services/Cloudflare/ZoneService.php @@ -162,11 +162,13 @@ class ZoneService extends CloudflareService public function expire(ZoneEntity $entity): void { $whois = Factory::get()->createWhois(); - $info = $whois->loadDomainInfo($entity->getTitle()); - if ($info) { + if ($whois->isDomainAvailable($entity->getTitle())) { + $info = $whois->loadDomainInfo($entity->getTitle()); $expire_date = date("Y-m-d", $info->expirationDate); $this->getModel()->modify($entity, ['expire_date' => $expire_date]); log_message('debug', __FUNCTION__ . " : {$entity->getTitle()} => {$expire_date}"); + } else { + log_message('debug', "{$entity->getTitle()} 이 도메인은 등록되지 않았습니다."); } }