From 1ca55cad8f7ba7f6a494e30af15253fdb8744869 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 21 Sep 2025 13:41:20 +0200 Subject: [PATCH] feat: Limit CPU_CORES to amount of physical cores (#1015) --- src/reset.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/reset.sh b/src/reset.sh index 46536c9..900622f 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -50,6 +50,11 @@ fi [ -n "${CPU_CORES//[0-9 ]}" ] && error "Invalid amount of CPU_CORES: $CPU_CORES" && exit 15 +if [ "$CPU_CORES" -gt "$CORES" ]; then + warn "The amount for CPU_CORES (${CPU_CORES}) exceeds the amount of physical cores, so will be limited to ${CORES}." + CPU_CORES="$CORES" +fi + # Check system if [ ! -d "/dev/shm" ]; then