Merge remote-tracking branch 'origin/main' into lint-fix

This commit is contained in:
Yuriy Dupyn 2024-02-05 23:54:38 +01:00
commit a3bc0b07e2
14 changed files with 10079 additions and 154 deletions

View file

@ -6,12 +6,12 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "1.35.1", features = ["full"] }
anyhow = "1.0.76"
clap = { version = "4.4.18", features = ["derive"] }
async-trait = "0.1.74"
rand = "0.8.5"
serde_json = "1.0.112"
anyhow = { workspace = true }
async-trait = { workspace = true }
clap = { workspace = true, features = ["derive"] }
rand = { workspace = true }
tokio = { workspace = true, features = ["io-util", "macros", "net", "rt-multi-thread", "time"] }
minisql = { path = "../minisql" }
parser = { path = "../parser" }
proto = { path = "../proto" }
parser = { path = "../parser" }

View file

@ -85,7 +85,7 @@ async fn handle_stream(
let mut wrapped_writer = ServerProtoWrapper::new(writer, config.get_throttle());
let result = match request {
Ok(req) => {
handle_connection(&mut reader, &mut wrapped_writer, req, state, token, config).await
handle_connection(&mut reader, &mut wrapped_writer, req, state, token).await
}
Err(ServerHandshakeError::IsCancelRequest(cancel)) => {
handle_cancellation(cancel.pid, cancel.secret, &tokens).await
@ -141,7 +141,6 @@ async fn handle_connection<R, W>(
request: HandshakeRequest,
state: SharedDbState,
token: ResetCancelToken,
config: Arc<Configuration>,
) -> anyhow::Result<()>
where
R: FrontendProtoReader + Send,
@ -157,7 +156,7 @@ where
break;
}
FrontendMessage::Query(data) => {
let result = handle_query(writer, &state, data.query.into(), &token, &config).await;
let result = handle_query(writer, &state, data.query.into(), &token).await;
match result {
Ok(_) => {}
Err(e) => writer.write_error_message(&e.to_string()).await?,
@ -176,7 +175,6 @@ async fn handle_query<W>(
state: &SharedDbState,
query: String,
token: &ResetCancelToken,
config: &Arc<Configuration>,
) -> anyhow::Result<()>
where
W: BackendProtoWriter + ProtoFlush + Send,