mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #893 from Dokploy/510-fractional-cpu-reservation-and-limit
refactor: remove calculation and pass resources as the docker api expect
This commit is contained in:
@@ -317,16 +317,12 @@ export const calculateResources = ({
|
||||
}: Resources): ResourceRequirements => {
|
||||
return {
|
||||
Limits: {
|
||||
MemoryBytes: memoryLimit ? memoryLimit * 1024 * 1024 : undefined,
|
||||
NanoCPUs: cpuLimit ? (cpuLimit || 1) * 1000 * 1000 * 1000 : undefined,
|
||||
MemoryBytes: memoryLimit ?? undefined,
|
||||
NanoCPUs: cpuLimit ?? undefined,
|
||||
},
|
||||
Reservations: {
|
||||
MemoryBytes: memoryReservation
|
||||
? (memoryReservation || 1) * 1024 * 1024
|
||||
: undefined,
|
||||
NanoCPUs: cpuReservation
|
||||
? (cpuReservation || 1) * 1000 * 1000 * 1000
|
||||
: undefined,
|
||||
MemoryBytes: memoryReservation ?? undefined,
|
||||
NanoCPUs: cpuReservation ?? undefined,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user