Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Fix null check for memory swappiness and CPU shares

Andras Bacsai31989997463c
diff --git a/app/Livewire/Project/Shared/ResourceLimits.php b/app/Livewire/Project/Shared/ResourceLimits.php
index a326a9a0b3..7671753131 100644
--- a/app/Livewire/Project/Shared/ResourceLimits.php
+++ b/app/Livewire/Project/Shared/ResourceLimits.php
@@ -35,7 +35,7 @@ class ResourceLimits extends Component
if (!$this->resource->limits_memory_swap) {
$this->resource->limits_memory_swap = "0";
}
- if (!$this->resource->limits_memory_swappiness) {
+ if (is_null($this->resource->limits_memory_swappiness)) {
$this->resource->limits_memory_swappiness = "60";
}
if (!$this->resource->limits_memory_reservation) {
@@ -47,7 +47,7 @@ class ResourceLimits extends Component
if ($this->resource->limits_cpuset === "") {
$this->resource->limits_cpuset = null;
}
- if (!$this->resource->limits_cpu_shares) {
+ if (is_null($this->resource->limits_cpu_shares)) {
$this->resource->limits_cpu_shares = 1024;
}
$this->validate();