mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 16:44:44 +02:00
Fix this up
This commit is contained in:
parent
d30accbc71
commit
367b9bd154
@ -303,17 +303,17 @@ class Node extends Model
|
|||||||
|
|
||||||
public function ipAddresses(): array
|
public function ipAddresses(): array
|
||||||
{
|
{
|
||||||
return cache()->remember("nodes.$this->id.servers", now()->addHour(), function () {
|
return cache()->remember("nodes.$this->id.ips", now()->addHour(), function () {
|
||||||
$ips = collect();
|
$ips = collect();
|
||||||
if (is_ip($this->fqdn)) {
|
if (is_ip($this->fqdn)) {
|
||||||
$ips->push($this->fqdn);
|
$ips = $ips->push($this->fqdn);
|
||||||
} elseif ($dnsRecords = gethostbynamel($this->fqdn)) {
|
} elseif ($dnsRecords = gethostbynamel($this->fqdn)) {
|
||||||
$ips->concat($dnsRecords);
|
$ips = $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->concat(fluent($addresses)->get('ip_addresses'));
|
$ips = $ips->concat(fluent($addresses)->get('ip_addresses'));
|
||||||
} catch (Exception) {
|
} catch (Exception) {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user