Skip to content

Commit

Permalink
code style improve
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskaliX committed Nov 30, 2023
1 parent 3168909 commit aa862f0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 22 deletions.
49 changes: 30 additions & 19 deletions plugins/eguard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,37 @@ fn main() -> Result<()> {
return;
}

match tokio::time::timeout(timeout, client_c.receive_async()).await {
Ok(result) => match result {
Ok(task) => match serde_json::from_str::<BpfConfig>(task.get_data()) {
Ok(config) => {
if let Err(e) = mgr_c.lock().unwrap().flush_config(config) {
error!("parse task failed: {}", e);
}
}
Err(e) => {
error!("parse task failed: {}", e);
}
},
Err(e) => {
error!("when receiving task, an error occurred: {}", e);
control_s.store(true, Ordering::SeqCst);
return;
}
},
Err(_) => {}
let result = match tokio::time::timeout(timeout, client_c.receive_async()).await {
Ok(result) => result,
Err(err) => {
error!("get task failed:{}", err);
continue;
}
};

let task = match result {
Ok(task) => task,
Err(err) => {
error!("when receiving task, an error occurred: {}", err);
control_s.store(true, Ordering::SeqCst);
return;
}
};

let config = match serde_json::from_str::<BpfConfig>(task.get_data()) {
Ok(config) => config,
Err(e) => {
error!("parse task failed: {}", e);
continue;
}
};

if let Err(e) = mgr_c.lock().unwrap().flush_config(config) {
error!("flush task failed: {}", e);
continue;
}

info!("task parse success")
}
});
rt.shutdown_background();
Expand Down
2 changes: 1 addition & 1 deletion server/webconsole/api/static/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</head>
<body>
<div id="root"></div>
<script src="/umi.21a330d4.js"></script>
<script src="/umi.db349b89.js"></script>

</body></html>

This file was deleted.

Large diffs are not rendered by default.

Loading

0 comments on commit aa862f0

Please sign in to comment.