Skip to content

Commit

Permalink
style: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SkuldNorniern committed May 30, 2024
1 parent 4f28ed6 commit 56ab1fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/net/live_fluereflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ pub async fn online_packet_capture(arg: Args) -> Result<(), FluereError> {
for (key, flow) in active_flow_guard.iter() {
if flow_timeout > 0 && flow.last < (time - (flow_timeout * 1000)) {
trace!("flow expired");

//plugin_manager.process_flow_data(*flow).await.unwrap();
records.push(*flow);
expired_flows.push(*key);
Expand All @@ -319,17 +319,14 @@ pub async fn online_packet_capture(arg: Args) -> Result<(), FluereError> {
let cloned_records = records.clone();
records.clear();
//let tasks = task::spawn(async {
//fluere_exporter(cloned_records, file).await;
//fluere_exporter(cloned_records, file).await;
//});
let file_path_clone = file_path.clone();
export_tasks.push(task::spawn(async move {
fluere_exporter(cloned_records, file).await;
debug!("Export {} Finished", file_path_clone);
}));




/*if verbose >= 1 {
println!("Export {} result: {:?}", file_path, result);
}*/
Expand Down
10 changes: 8 additions & 2 deletions src/net/online_fluereflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,15 @@ pub async fn packet_capture(arg: Args) -> Result<(), FluereError> {
let cloned_plugin_manager = plugin_manager.clone();
tasks.push(task::spawn(async move {
for flow in &expired_flow_data {
cloned_plugin_manager.process_flow_data(*flow).await.unwrap();
cloned_plugin_manager
.process_flow_data(*flow)
.await
.unwrap();
}
debug!("Sending {} expired flows to plugins done", expired_flow_data.len());
debug!(
"Sending {} expired flows to plugins done",
expired_flow_data.len()
);
}));

active_flow.retain(|key, _| !expired_flows.contains(key));
Expand Down

0 comments on commit 56ab1fc

Please sign in to comment.