mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 13:24:46 +02:00
Small refactor
This commit is contained in:
parent
dea310e9ab
commit
ee142a26b0
@ -306,14 +306,14 @@ class Node extends Model
|
||||
return cache()->remember("nodes.$this->id.servers", now()->addHour(), function () {
|
||||
$ips = collect();
|
||||
if (is_ip($this->fqdn)) {
|
||||
$ips = $ips->add($this->fqdn);
|
||||
$ips->push($this->fqdn);
|
||||
} else if ($dnsRecords = gethostbynamel($this->fqdn)) {
|
||||
$ips = $ips->merge($dnsRecords);
|
||||
$ips->concat($dnsRecords);
|
||||
}
|
||||
|
||||
try {
|
||||
$addresses = Http::daemon($this)->connectTimeout(1)->timeout(1)->get('/api/system/ips')->json();
|
||||
$ips = $ips->merge(fluent($addresses)->get('ip_addresses'));
|
||||
$ips->concat(fluent($addresses)->get('ip_addresses'));
|
||||
} catch (Exception) {
|
||||
// pass
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user