Skip to content

Commit

Permalink
Make sure requested limits are numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Jan 12, 2024
1 parent 50c933d commit a16844d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/extractResourceLimitsFromRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default function extractResourceLimitsFromRequest(
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
requestBody: any,
): ResourceLimits {
let memoryGB = requestBody.memory_limit_gb ?? 1
let cpus = requestBody.cpu_limit ?? 1
let memoryGB = Number(requestBody.memory_limit_gb ?? 1)
let cpus = Number(requestBody.cpu_limit ?? 1)
if (memoryGB > MAX_MEMORY_REQUEST_GB) {
memoryGB = MAX_MEMORY_REQUEST_GB
}
Expand Down

0 comments on commit a16844d

Please sign in to comment.