Fix 500 when viewing node (#1144)

* Fix node 500

* this feels better

* Update app/Models/Node.php

Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>

* Update app/Models/Node.php

Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>

* pint

---------

Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>
This commit is contained in:
Charles 2025-03-23 17:43:51 -04:00 committed by GitHub
parent b69136d7a4
commit 5bea1ea80a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -365,16 +365,20 @@ class Node extends Model implements Validatable
];
try {
$this->systemInformation();
return Http::daemon($this)
$data = Http::daemon($this)
->connectTimeout(1)
->timeout(1)
->get('/api/system/utilization')
->json() ?? $default;
->json();
if ($data['memory_total']) {
return $data;
}
} catch (Exception) {
return $default;
}
return $default;
}
/** @return string[] */