Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor refactor of functionally same code #607

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nativelink-service/src/bytestream_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl ByteStreamServer {
// Trim the error code. Not Found is quite common and we don't want to send a large
// error (debug) message for something that is common. We resize to just the last
// message as it will be the most relevant.
e.messages.resize_with(1, || "".to_string());
e.messages.truncate(1);
}
info!("\x1b[0;31mBytestream Read Chunk Resp\x1b[0m: Error {:?}", e);
return Some((Err(e.into()), None))
Expand Down
4 changes: 1 addition & 3 deletions nativelink-store/src/grpc_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,7 @@ impl Store for GrpcStore {
.message()
.await
.err_tip(|| "While fetching message in GrpcStore::get_part()")?;
let message = if let Some(message) = maybe_message {
message
} else {
let Some(message) = maybe_message else {
writer
.send_eof()
.await
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/evicting_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl<T: LenEntry + Debug, I: InstantWrapper> MetricsComponent for EvictingMap<T,
&state.sum_store_size,
"Total size of all items in the store",
);
c.publish("items_in_store_total", &state.lru.len(), "Mumber of items in the store");
c.publish("items_in_store_total", &state.lru.len(), "Number of items in the store");
c.publish(
"oldest_item_timestamp",
&state
Expand Down