Skip to content

Commit

Permalink
bump axum, fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 committed Jan 3, 2025
1 parent 7245dfe commit 2f0b7c3
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 47 deletions.
124 changes: 85 additions & 39 deletions scylla-server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions scylla-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ serde = "1.0.203"
protobuf-codegen = "3.7.1"
protobuf = { version = "3.7.1", features = ["with-bytes"] }
tokio = { version = "1.38.0", features = ["full", "tracing"] }
axum = { version = "0.7.5", features = ["multipart"] }
axum = { version = "0.8.1", features = ["multipart"] }
tower = { version = "0.5.2", features = ["timeout"] }
tower-http = { version = "0.6.2", features = ["cors", "trace"] }
socketioxide = { version = "0.15.1", features = ["tracing"] }
Expand All @@ -24,12 +24,12 @@ rand = "0.8.5"
console-subscriber = { version = "0.4.1", optional = true }
ringbuffer = "0.15.0"
clap = { version = "4.5.11", features = ["derive", "env"] }
axum-extra = { version = "0.9.3", features = ["query"] }
axum-extra = { version = "0.10.0", features = ["query"] }
chrono = { version = "0.4.38", features = ["serde"] }
serde_json = "1.0.128"
diesel_migrations = { version = "2.2.0", features = ["postgres"] }
rangemap = "1.5.1"
axum-macros = "0.4.2"
axum-macros = "0.5.0"
diesel-async = { version = "0.5.2", features = ["postgres", "bb8", "async-connection-wrapper", "sync-connection-wrapper"] }
rustc-hash = "2.1.0"
[target.'cfg(not(target_env = "msvc"))'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions scylla-server/src/db_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ fn chunk_vec<T: Clone>(input: Vec<T>, max_chunk_size: usize) -> Vec<Vec<T>> {
}

// Calculate the number of chunks
let num_chunks = (len + max_chunk_size - 1) / max_chunk_size;
let num_chunks = len.div_ceil(max_chunk_size);

// Recompute a balanced chunk size
let chunk_size = usize::max(1, (len + num_chunks - 1) / num_chunks);
let chunk_size = usize::max(1, len.div_ceil(num_chunks));

let mut result = Vec::with_capacity(num_chunks);
let mut start = 0;
Expand Down
6 changes: 3 additions & 3 deletions scylla-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,17 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let app = Router::new()
// DATA
.route(
"/data/:dataTypeName/:runId",
"/data/{dataTypeName}/{runId}",
get(controllers::data_controller::get_data),
)
// DATA TYPE
.route("/datatypes", get(data_type_controller::get_all_data_types))
.route("/runs", get(run_controller::get_all_runs))
.route("/runs/:id", get(run_controller::get_run_by_id))
.route("/runs/{id}", get(run_controller::get_run_by_id))
.route("/runs/new", post(run_controller::new_run))
// CONFIG
.route(
"/config/set/:configKey",
"/config/set/{configKey}",
post(car_command_controller::send_config_command).layer(Extension(client_sharable)),
)
// FILE INSERT
Expand Down

0 comments on commit 2f0b7c3

Please sign in to comment.