Skip to content

Commit

Permalink
Merge pull request #162 from abdolence/gcloud-sdk-0-24-5-support
Browse files Browse the repository at this point in the history
Google Cloud SDK v0.24.5 support
  • Loading branch information
abdolence authored Apr 2, 2024
2 parents d712151 + 67a59e3 commit 66e1c06
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ caching-persistent = ["caching", "dep:redb"]

[dependencies]
tracing = "0.1"
gcloud-sdk = { version = "0.24", features = ["google-firestore-v1"] }
hyper = { version ="0.14" }
gcloud-sdk = { version = "0.24.5", features = ["google-firestore-v1"] }
hyper = { version = "0.14" }
struct-path = "0.2"
rvstruct = "0.3.2"
rsb_derive = "0.5"
Expand Down
29 changes: 15 additions & 14 deletions src/db/aggregated_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ impl FirestoreDb {
query_type: Some(gcloud_sdk::google::firestore::v1::structured_aggregation_query::QueryType::StructuredQuery(params.query_params.into())),
}
)),
explain_options: None,
}))
}

Expand Down Expand Up @@ -338,23 +339,23 @@ impl FirestoreDb {
}
Err(err) => match err {
FirestoreError::DatabaseError(ref db_err)
if db_err.retry_possible && retries < self.inner.options.max_retries =>
{
warn!(
if db_err.retry_possible && retries < self.inner.options.max_retries =>
{
warn!(
err = %db_err,
current_retry = retries + 1,
max_retries = self.inner.options.max_retries,
"Failed to run aggregation query. Retrying up to the specified number of times.",
);

self.stream_aggregated_query_doc_with_retries(params, retries + 1, span)
.await
}
self.stream_aggregated_query_doc_with_retries(params, retries + 1, span)
.await
}
_ => Err(err),
},
}
}
.boxed()
.boxed()
}

fn aggregated_query_doc_with_retries<'a>(
Expand Down Expand Up @@ -402,23 +403,23 @@ impl FirestoreDb {
}
Err(err) => match err {
FirestoreError::DatabaseError(ref db_err)
if db_err.retry_possible && retries < self.inner.options.max_retries =>
{
warn!(
if db_err.retry_possible && retries < self.inner.options.max_retries =>
{
warn!(
err = %db_err,
current_retry = retries + 1,
max_retries = self.inner.options.max_retries,
"Failed to run aggregation query. Retrying up to the specified number of times.",
);

self.aggregated_query_doc_with_retries(params, retries + 1, span)
.await
}
self.aggregated_query_doc_with_retries(params, retries + 1, span)
.await
}
_ => Err(err),
},
}
}
.boxed()
.boxed()
}

fn aggregated_response_to_doc(mut agg_res: RunAggregationQueryResponse) -> Option<Document> {
Expand Down
1 change: 1 addition & 0 deletions src/db/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ impl FirestoreDb {
.map(|selector| selector.try_into())
.transpose()?,
query_type: Some(run_query_request::QueryType::StructuredQuery(params.into())),
explain_options: None,
}))
}

Expand Down
1 change: 1 addition & 0 deletions src/db/query_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ impl From<FirestoreQueryParams> for StructuredQuery {
.collect(),
},
r#where: query_filter,
find_nearest: None,
}
}
}
Expand Down

0 comments on commit 66e1c06

Please sign in to comment.