From 50c933d9be90bf02516bc87ac7f4af35f336d0b1 Mon Sep 17 00:00:00 2001 From: Henrik Nygren Date: Fri, 12 Jan 2024 16:15:58 +0200 Subject: [PATCH] Fix checking limits --- src/middleware/gatekeeper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/middleware/gatekeeper.ts b/src/middleware/gatekeeper.ts index 8979be6..1a348fd 100644 --- a/src/middleware/gatekeeper.ts +++ b/src/middleware/gatekeeper.ts @@ -38,10 +38,10 @@ const gateKeeper = async ( console.info( `Sandbox sumbission requesting ${limits.memoryGB}GB of memory and ${limits.cpus} CPUs`, ) - if (reservedCPUCores + limits.cpus >= CPU_CORES_IN_SYSTEM) { + if (reservedCPUCores + limits.cpus > CPU_CORES_IN_SYSTEM) { throw new SandboxBusyError() } - if (reservedMemory + limits.memoryGB >= TOTAL_SYSTEM_MEMORY_GB) { + if (reservedMemory + limits.memoryGB > TOTAL_SYSTEM_MEMORY_GB) { throw new SandboxBusyError() } reserveInstance(limits)