mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
Run cargo fmt, clean up imports
This commit is contained in:
parent
80447d9d1b
commit
49ed4371e7
13 changed files with 125 additions and 83 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use std::net::SocketAddr;
|
||||
|
||||
use aquatic_common::{access_list::AccessListConfig, privileges::PrivilegeConfig};
|
||||
use aquatic_common::cpu_pinning::CpuPinningConfig;
|
||||
use aquatic_common::{access_list::AccessListConfig, privileges::PrivilegeConfig};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use aquatic_cli_helpers::LogLevel;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ use glommio::prelude::*;
|
|||
use crate::common::*;
|
||||
use crate::config::Config;
|
||||
|
||||
pub async fn update_access_list<C: Borrow<Config>>(config: C, access_list: Rc<RefCell<AccessList>>) {
|
||||
pub async fn update_access_list<C: Borrow<Config>>(
|
||||
config: C,
|
||||
access_list: Rc<RefCell<AccessList>>,
|
||||
) {
|
||||
if config.borrow().access_list.mode.is_on() {
|
||||
match BufferedFile::open(&config.borrow().access_list.path).await {
|
||||
Ok(file) => {
|
||||
|
|
@ -46,4 +49,4 @@ pub async fn update_access_list<C: Borrow<Config>>(config: C, access_list: Rc<Re
|
|||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,7 @@ pub fn run(config: Config) -> anyhow::Result<()> {
|
|||
let mut builder = LocalExecutorBuilder::default();
|
||||
|
||||
if config.cpu_pinning.active {
|
||||
builder =
|
||||
builder.pin_to_cpu(config.cpu_pinning.offset + 1 + config.socket_workers + i);
|
||||
builder = builder.pin_to_cpu(config.cpu_pinning.offset + 1 + config.socket_workers + i);
|
||||
}
|
||||
|
||||
let executor = builder.spawn(|| async move {
|
||||
|
|
@ -88,7 +87,12 @@ pub fn run(config: Config) -> anyhow::Result<()> {
|
|||
executors.push(executor);
|
||||
}
|
||||
|
||||
drop_privileges_after_socket_binding(&config.privileges, num_bound_sockets, config.socket_workers).unwrap();
|
||||
drop_privileges_after_socket_binding(
|
||||
&config.privileges,
|
||||
num_bound_sockets,
|
||||
config.socket_workers,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
for executor in executors {
|
||||
executor
|
||||
|
|
|
|||
|
|
@ -27,4 +27,4 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
|
|||
mio::run(config)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,12 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
|
|||
|
||||
start_workers(config.clone(), state.clone(), num_bound_sockets.clone())?;
|
||||
|
||||
drop_privileges_after_socket_binding(&config.privileges, num_bound_sockets, config.socket_workers).unwrap();
|
||||
drop_privileges_after_socket_binding(
|
||||
&config.privileges,
|
||||
num_bound_sockets,
|
||||
config.socket_workers,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
loop {
|
||||
::std::thread::sleep(Duration::from_secs(config.cleaning.interval));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue