Skip to content

Commit

Permalink
spruce up comments, fix dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 committed Jan 7, 2025
1 parent 2f0b7c3 commit 123732e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scylla-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ serde_json = "1.0.128"
diesel_migrations = { version = "2.2.0", features = ["postgres"] }
rangemap = "1.5.1"
axum-macros = "0.5.0"
diesel-async = { version = "0.5.2", features = ["postgres", "bb8", "async-connection-wrapper", "sync-connection-wrapper"] }
diesel-async = { version = "0.5.2", features = ["postgres", "bb8", "async-connection-wrapper", "sync-connection-wrapper", "tokio"] }
rustc-hash = "2.1.0"
[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion scylla-server/src/db_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ impl DbHandler {
if !self.data_queue.is_empty() {
// set a new max if this batch is larger
max_batch_size = usize::max(max_batch_size, self.data_queue.len());
// mem::take allows us to assign the value of data queue vec::new() while maintaining the memory for data_channel ownership
data_channel
.send(self.data_queue)
.await
.expect("Could not comm data to db thread");
// give a vector a size that hopefully is big enough to fit the next batch
self.data_queue = Vec::with_capacity((max_batch_size as f32 * 1.05) as usize);
}
}
Expand Down

0 comments on commit 123732e

Please sign in to comment.