delete file and remove token from hashmap

This commit is contained in:
nganhkhoa 2022-05-05 23:52:57 +07:00
parent 379406a331
commit 459754bd8c

View File

@ -99,7 +99,9 @@ async fn process_request(request: Request, token_list: TokenList, build_sender:
build_sender.send(args).await.ok();
},
Request::Delete(token) => {
println!("delete file with token={}", token);
fs::remove_file(format!("./out/ssm-{}", token)).await.ok();
let mut token_list = token_list.lock().unwrap();
token_list.remove(&token);
}
}
}