Skip to content

Commit

Permalink
Merge branch 'chriskaliX:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TimelifeCzy authored Dec 1, 2023
2 parents 03a4f4d + aa15300 commit b5690db
Show file tree
Hide file tree
Showing 4 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.273740a8.js"></script>

</body></html>
Loading

0 comments on commit b5690db

Please sign in to comment.