Skip to content

Commit

Permalink
[Salvo] Upgrade to 0.74 (#9437)
Browse files Browse the repository at this point in the history
* [Salvo] Upgrade to  0.74

* rust 1.83

* docker update
  • Loading branch information
chrislearn authored Dec 9, 2024
1 parent f7bba3f commit 6007c64
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions frameworks/Rust/salvo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ diesel = { version = "2", features = ["postgres", "r2d2"] }
deadpool = { version = "0.12", features = ["rt_tokio_1", "serde", "managed"] }
deadpool-postgres = "0.14"
futures-util = "0.3"
lru = "0.12.0"
lru = "0.12"
markup = "0.15"
# mimalloc = { version = "0.1", default-features = false }
mongodb = { version = "2.4.0", features = ["zstd-compression", "snappy-compression", "zlib-compression"] }
mongodb = { version = "2", features = ["zstd-compression", "snappy-compression", "zlib-compression"] }
once_cell = "1"
rand = { version = "0.8", features = ["min_const_gen", "small_rng"] }
salvo = { version = "0.68", default-features = false, features = ["anyhow", "server", "http1", "affix"] }
salvo = { version = "0.74", default-features = false, features = ["anyhow", "server", "http1", "affix-state"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# smallvec = "1"
Expand All @@ -60,7 +60,7 @@ tokio-pg-mapper = "0.2.0"
tokio-pg-mapper-derive = "0.2.0"
tokio-postgres = "0.7"
v_htmlescape = "0.15"
dotenv = "0.15.0"
dotenvy = "0.15"

[profile.release]
lto = true
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/salvo-diesel.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.78-buster
FROM rust:1.83

ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world
ENV TECHEMPOWER_MAX_POOL_SIZE=28
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/salvo-lru.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.78-buster
FROM rust:1.83

ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world

Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/salvo-mongo-raw.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.78-buster
FROM rust:1.83

ENV TECHEMPOWER_MONGODB_URL=mongodb://tfb-database:27017
ENV TECHEMPOWER_MAX_POOL_SIZE=28
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/salvo-mongo.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.78-buster
FROM rust:1.83

ENV TECHEMPOWER_MONGODB_URL=mongodb://tfb-database:27017
ENV TECHEMPOWER_MAX_POOL_SIZE=28
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/salvo-pg-pool.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.78-buster
FROM rust:1.83

ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world
ENV TECHEMPOWER_MAX_POOL_SIZE=28
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/salvo-pg.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.78-buster
FROM rust:1.83

ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world

Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/salvo-sqlx.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.78-buster
FROM rust:1.83

ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world
ENV TECHEMPOWER_MAX_POOL_SIZE=56
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/salvo.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.78-buster
FROM rust:1.83

ADD ./ /salvo
WORKDIR /salvo
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/src/main_diesel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::thread::available_parallelism;
use anyhow::Error;
use diesel::prelude::*;
use diesel::r2d2::{ConnectionManager, Pool, PoolError, PooledConnection};
use dotenv::dotenv;
use dotenvy::dotenv;
use once_cell::sync::OnceCell;
use rand::rngs::SmallRng;
use rand::{Rng, SeedableRng};
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/src/main_lru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::thread::available_parallelism;

use anyhow::Error;
use bytes::Bytes;
use dotenv::dotenv;
use dotenvy::dotenv;
use lru::LruCache;
use once_cell::sync::OnceCell;
use rand::rngs::SmallRng;
Expand Down
4 changes: 2 additions & 2 deletions frameworks/Rust/salvo/src/main_mongo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::time::Duration;

use anyhow::Error;
use bytes::Bytes;
use dotenv::dotenv;
use dotenvy::dotenv;
use mongodb::{
options::{ClientOptions, Compressor},
Client, Database,
Expand Down Expand Up @@ -177,7 +177,7 @@ async fn serve() {
let database = client.database("hello_world");

let router = Router::new()
.hoop(salvo::affix::inject(database))
.hoop(salvo::affix_state::inject(database))
.push(Router::with_path("db").get(world_row))
.push(Router::with_path("fortunes").get(fortunes))
.push(Router::with_path("queries").get(queries))
Expand Down
4 changes: 2 additions & 2 deletions frameworks/Rust/salvo/src/main_mongo_raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::time::Duration;

use anyhow::Error;
use bytes::Bytes;
use dotenv::dotenv;
use dotenvy::dotenv;
use mongodb::{
options::{ClientOptions, Compressor},
Client, Database,
Expand Down Expand Up @@ -140,7 +140,7 @@ async fn serve() {
let database = client.database("hello_world");

let router = Router::new()
.hoop(salvo::affix::inject(database))
.hoop(salvo::affix_state::inject(database))
.push(Router::with_path("db").get(world_row))
.push(Router::with_path("queries").get(queries))
.push(Router::with_path("updates").get(updates));
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/src/main_pg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::thread::available_parallelism;

use async_trait::async_trait;
use bytes::Bytes;
use dotenv::dotenv;
use dotenvy::dotenv;
use salvo::conn::tcp::TcpAcceptor;
use salvo::http::header::{self, HeaderValue};
use salvo::http::ResBody;
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/src/main_pg_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::thread::available_parallelism;
use anyhow::Error;
use bytes::Bytes;
use deadpool_postgres::Pool;
use dotenv::dotenv;
use dotenvy::dotenv;
use futures_util::{stream::FuturesUnordered, TryStreamExt};
use once_cell::sync::OnceCell;
use rand::rngs::SmallRng;
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/salvo/src/main_sqlx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::thread::available_parallelism;

use anyhow::Error;
use bytes::Bytes;
use dotenv::dotenv;
use dotenvy::dotenv;
use once_cell::sync::OnceCell;
use rand::rngs::SmallRng;
use rand::{Rng, SeedableRng};
Expand Down

0 comments on commit 6007c64

Please sign in to comment.