Skip to content

Commit 5fdb0a5

Browse files
committed
Correctly expose OOM disable state for a server
1 parent f5a1ce1 commit 5fdb0a5

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
66
## v1.6.1
77
### Fixed
88
* Fixes server build modifications not being properly persisted to the database when edited.
9-
9+
* Correctly exposes the `oom_disabled` field in the `build` limits block for a server build so that Wings can pick it up.
10+
*
1011
## v1.6.0
1112
### Fixed
1213
* Fixes array merging logic for server transfers that would cause a 500 error to occur in some scenarios.

app/Services/Servers/ServerConfigurationStructureService.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ protected function returnCurrentFormat(Server $server): array
5858
'cpu_limit' => $server->cpu,
5959
'threads' => $server->threads,
6060
'disk_space' => $server->disk,
61+
'oom_disabled' => $server->oom_disabled,
6162
],
6263
'container' => [
6364
'image' => $server->image,
65+
// This field is deprecated — use the value in the "build" block.
66+
//
67+
// TODO: remove this key in V2.
6468
'oom_disabled' => $server->oom_disabled,
6569
'requires_rebuild' => false,
6670
],

app/Transformers/Api/Application/ServerTransformer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function transform(Server $server): array
6969
'io' => $server->io,
7070
'cpu' => $server->cpu,
7171
'threads' => $server->threads,
72+
'oom_disabled' => $server->oom_disabled,
7273
],
7374
'feature_limits' => [
7475
'databases' => $server->database_limit,

app/Transformers/Api/Client/ServerTransformer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public function transform(Server $server): array
5555
'disk' => $server->disk,
5656
'io' => $server->io,
5757
'cpu' => $server->cpu,
58+
'threads' => $server->threads,
59+
'oom_disabled' => $server->oom_disabled,
5860
],
5961
'invocation' => $service->handle($server, !$this->getUser()->can(Permission::ACTION_STARTUP_READ, $server)),
6062
'docker_image' => $server->image,

0 commit comments

Comments
 (0)