Skip to content

Commit

Permalink
feat: add retry for do_get
Browse files Browse the repository at this point in the history
  • Loading branch information
dqhl76 committed Aug 22, 2024
1 parent 2c45ee4 commit 0357267
Show file tree
Hide file tree
Showing 14 changed files with 700 additions and 184 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ http = "1"
itertools = "0.10.5"
jsonb = "0.4.1"
jwt-simple = "0.11.0"
hyper = "0.14.20"
match-template = "0.0.1"
mysql_async = { version = "0.34", default-features = false, features = ["native-tls-tls"] }
object_store_opendal = "0.46"
Expand Down
1 change: 1 addition & 0 deletions src/common/exception/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ serde_json = { workspace = true }
tantivy = { workspace = true }
thiserror = { workspace = true }
tonic = { workspace = true }
hyper = {workspace = true}

[package.metadata.cargo-machete]
ignored = ["geos"]
Expand Down
7 changes: 7 additions & 0 deletions src/common/exception/src/exception_into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,13 @@ impl From<tonic::Status> for ErrorCode {
tonic::Code::Unknown => {
let details = status.details();
if details.is_empty() {
if status.source().map_or(false, |e| e.is::<hyper::Error>()) {
return ErrorCode::CannotConnectNode(format!(
"{}, source: {:?}",
status.message(),
status.source()
));
}
return ErrorCode::UnknownException(format!(
"{}, source: {:?}",
status.message(),
Expand Down
Loading

0 comments on commit 0357267

Please sign in to comment.