From 4a5610ce14195c532d02471de0b6e7461f43f9d8 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Mon, 4 Mar 2024 14:14:16 -0500 Subject: [PATCH] Fix incorrect warning on Linux --- src/Tgstation.Server.Host/System/PosixProcessFeatures.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Tgstation.Server.Host/System/PosixProcessFeatures.cs b/src/Tgstation.Server.Host/System/PosixProcessFeatures.cs index 9d97d20be5..f9894e9ac9 100644 --- a/src/Tgstation.Server.Host/System/PosixProcessFeatures.cs +++ b/src/Tgstation.Server.Host/System/PosixProcessFeatures.cs @@ -172,10 +172,11 @@ namespace Tgstation.Server.Host.System var originalOomAdjust = Int16.Parse(trimmedString, CultureInfo.InvariantCulture); baselineOomAdjust = Math.Clamp(originalOomAdjust, (short)-1000, (short)1000); - if (originalOomAdjust != baselineOomAdjust) - logger.LogWarning("oom_score_adj is at it's limit of 1000 (Clamped from {original}). TGS cannot guarantee the kill order of its parent/child processes!", originalOomAdjust); - else - logger.LogWarning("oom_score_adj is at it's limit of 1000. TGS cannot guarantee the kill order of its parent/child processes!"); + if (baselineOomAdjust == 1000) + if (originalOomAdjust != baselineOomAdjust) + logger.LogWarning("oom_score_adj is at it's limit of 1000 (Clamped from {original}). TGS cannot guarantee the kill order of its parent/child processes!", originalOomAdjust); + else + logger.LogWarning("oom_score_adj is at it's limit of 1000. TGS cannot guarantee the kill order of its parent/child processes!"); try {