Skip to content

Commit

Permalink
Fix checking limits
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Jan 12, 2024
1 parent f462011 commit 50c933d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middleware/gatekeeper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 50c933d

Please sign in to comment.