mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 20:24:44 +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 () {
|
return cache()->remember("nodes.$this->id.servers", now()->addHour(), function () {
|
||||||
$ips = collect();
|
$ips = collect();
|
||||||
if (is_ip($this->fqdn)) {
|
if (is_ip($this->fqdn)) {
|
||||||
$ips = $ips->add($this->fqdn);
|
$ips->push($this->fqdn);
|
||||||
} else if ($dnsRecords = gethostbynamel($this->fqdn)) {
|
} else if ($dnsRecords = gethostbynamel($this->fqdn)) {
|
||||||
$ips = $ips->merge($dnsRecords);
|
$ips->concat($dnsRecords);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$addresses = Http::daemon($this)->connectTimeout(1)->timeout(1)->get('/api/system/ips')->json();
|
$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) {
|
} catch (Exception) {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user