From b351c07d34896f56795d1969f1819eee30c313f2 Mon Sep 17 00:00:00 2001 From: AreYouScared Date: Sun, 29 Mar 2020 16:55:06 -0400 Subject: [PATCH] Fix server transformer Properly pass the value to wings --- app/Models/Server.php | 2 ++ app/Services/Servers/ServerConfigurationStructureService.php | 2 +- app/Transformers/Api/Application/ServerTransformer.php | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Models/Server.php b/app/Models/Server.php index 9bdb19ff1..0ccd0080a 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -105,6 +105,7 @@ class Server extends Validable 'swap' => 'required|numeric|min:-1', 'io' => 'required|numeric|between:10,1000', 'cpu' => 'required|numeric|min:0', + 'threads' => 'present|nullable|regex:/^([\d-,]+)$/', 'oom_disabled' => 'sometimes|boolean', 'disk' => 'required|numeric|min:0', 'allocation_id' => 'required|bail|unique:servers|exists:allocations,id', @@ -134,6 +135,7 @@ class Server extends Validable 'disk' => 'integer', 'io' => 'integer', 'cpu' => 'integer', + 'threads' => 'string', 'oom_disabled' => 'boolean', 'allocation_id' => 'integer', 'nest_id' => 'integer', diff --git a/app/Services/Servers/ServerConfigurationStructureService.php b/app/Services/Servers/ServerConfigurationStructureService.php index 91955892e..69950b230 100644 --- a/app/Services/Servers/ServerConfigurationStructureService.php +++ b/app/Services/Servers/ServerConfigurationStructureService.php @@ -81,7 +81,7 @@ class ServerConfigurationStructureService 'swap' => $server->swap, 'io_weight' => $server->io, 'cpu_limit' => $server->cpu, - 'cpu_threads' => $server->threads, + 'threads' => $server->threads, 'disk_space' => $server->disk, ], 'service' => [ diff --git a/app/Transformers/Api/Application/ServerTransformer.php b/app/Transformers/Api/Application/ServerTransformer.php index 70dc185d6..4fb31212d 100644 --- a/app/Transformers/Api/Application/ServerTransformer.php +++ b/app/Transformers/Api/Application/ServerTransformer.php @@ -75,6 +75,7 @@ class ServerTransformer extends BaseTransformer 'disk' => $server->disk, 'io' => $server->io, 'cpu' => $server->cpu, + 'threads' => $server->threads, ], 'feature_limits' => [ 'databases' => $server->database_limit,