fmt modify
This commit is contained in:
parent
a9f1dcf777
commit
2236ba39d9
|
|
@ -217,8 +217,7 @@ pub fn update_resources(pid: u32, resources: &LinuxResources) -> Result<()> {
|
|||
Subsystem::Mem(mem_ctr) => {
|
||||
if let Some(memory) = resources.memory() {
|
||||
//if swap and limit setting have
|
||||
match (memory.limit(), memory.swap()) {
|
||||
(Some(limit), Some(swap)) => {
|
||||
if let (Some(limit), Some(swap)) = (memory.limit(), memory.swap()) {
|
||||
//get current memory_limit
|
||||
let current = mem_ctr.memory_stat().limit_in_bytes;
|
||||
// if the updated swap value is larger than the current memory limit set the swap changes first
|
||||
|
|
@ -232,8 +231,6 @@ pub fn update_resources(pid: u32, resources: &LinuxResources) -> Result<()> {
|
|||
.map_err(other_error!(e, "set mem limit"))?;
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
// set memory limit in bytes
|
||||
if let Some(limit) = memory.limit() {
|
||||
mem_ctr
|
||||
|
|
|
|||
Loading…
Reference in New Issue