Browse Source

Update salvo to 0.67 (#8846)

* Update salvo to 0.67

* remove useless import
Chrislearn Young 1 year ago
parent
commit
2765ca23f9

+ 3 - 3
frameworks/Rust/salvo/Cargo.toml

@@ -40,8 +40,8 @@ anyhow = "1"
 async-trait = "0.1"
 bytes = "1"
 diesel = { version = "2", features = ["postgres", "r2d2"] }
-deadpool = { version = "0.10", features = ["rt_tokio_1", "serde", "async-trait", "managed"] }
-deadpool-postgres = "0.11"
+deadpool = { version = "0.11", features = ["rt_tokio_1", "serde", "managed"] }
+deadpool-postgres = "0.13"
 futures-util = "0.3"
 lru = "0.12.0"
 markup = "0.15"
@@ -49,7 +49,7 @@ markup = "0.15"
 mongodb = { version = "2.4.0", features = ["zstd-compression", "snappy-compression", "zlib-compression"] }
 once_cell = "1"
 rand = { version = "0.8", features = ["min_const_gen", "small_rng"] }
-salvo = { version = "0.63", default-features = false, features = ["anyhow", "server", "http1", "affix"] }
+salvo = { version = "0.67", default-features = false, features = ["anyhow", "server", "http1", "affix"] }
 serde = { version = "1", features = ["derive"] }
 serde_json = "1"
 # smallvec = "1"

+ 1 - 1
frameworks/Rust/salvo/salvo-diesel.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.74
+FROM rust:1.77
 
 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world
 ENV TECHEMPOWER_MAX_POOL_SIZE=28

+ 1 - 1
frameworks/Rust/salvo/salvo-lru.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.74
+FROM rust:1.77
 
 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world
 

+ 1 - 1
frameworks/Rust/salvo/salvo-mongo-raw.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.74
+FROM rust:1.77
 
 ENV TECHEMPOWER_MONGODB_URL=mongodb://tfb-database:27017
 ENV TECHEMPOWER_MAX_POOL_SIZE=28

+ 1 - 1
frameworks/Rust/salvo/salvo-mongo.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.74
+FROM rust:1.77
 
 ENV TECHEMPOWER_MONGODB_URL=mongodb://tfb-database:27017
 ENV TECHEMPOWER_MAX_POOL_SIZE=28

+ 1 - 1
frameworks/Rust/salvo/salvo-pg-pool.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.74
+FROM rust:1.77
 
 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world
 ENV TECHEMPOWER_MAX_POOL_SIZE=28

+ 1 - 1
frameworks/Rust/salvo/salvo-pg.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.74
+FROM rust:1.77
 
 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world
 

+ 1 - 1
frameworks/Rust/salvo/salvo-sqlx.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.74
+FROM rust:1.77
 
 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world
 ENV TECHEMPOWER_MAX_POOL_SIZE=56

+ 1 - 1
frameworks/Rust/salvo/salvo.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.74
+FROM rust:1.77
 
 ADD ./ /salvo
 WORKDIR /salvo

+ 2 - 2
frameworks/Rust/salvo/src/main.rs

@@ -4,7 +4,6 @@
 use std::sync::Arc;
 
 use bytes::Bytes;
-use salvo::conn::tcp::TcpAcceptor;
 use salvo::http::body::ResBody;
 use salvo::http::header::{self, HeaderValue};
 use salvo::prelude::*;
@@ -50,7 +49,8 @@ fn main() {
 }
 
 async fn serve(router: Arc<Router>) {
-    let acceptor: TcpAcceptor = utils::reuse_listener().unwrap().try_into().unwrap();
+    // let acceptor: TcpAcceptor = utils::reuse_listener().unwrap().try_into().unwrap();
+    let acceptor = TcpListener::new("0.0.0.0:8080").bind().await;
     let mut server = Server::new(acceptor);
     let http1 = server.http1_mut();
     http1.pipeline_flush(true);