refactor: cleanup logging

This commit is contained in:
Jindřich Moravec 2024-01-27 20:03:36 +01:00
parent 9f3dbe3fdb
commit 08b10636c2

View file

@ -99,6 +99,8 @@ async fn create_token(tokens: &TokenStore) -> anyhow::Result<(i32, i32, ResetCan
}
async fn handle_cancellation(pid: i32, key: i32, tokens: &TokenStore) -> anyhow::Result<()> {
println!("Cancel request, PID: {}, Key: {}", pid, key);
let tokens = tokens.lock().await;
let token = tokens.get(&(pid, key));
match token {
@ -114,19 +116,16 @@ where
R: FrontendProtoReader + Send,
W: BackendProtoWriter + ProtoFlush + Send,
{
println!("Handshake complete:\n{request:?}");
println!("Client connected: {:?}", request);
loop {
println!("Waiting for next message");
let next: FrontendMessage = reader.read_proto().await?;
match next {
FrontendMessage::Terminate => {
println!("Received Terminate");
break;
}
FrontendMessage::Query(data) => {
println!("Received Query: {:?}", data.query);
let result = handle_query(writer, &state, data.query.into(), &token).await;
match result {
Ok(_) => {}