Skip to content

Commit

Permalink
fix: Refresh JWT only when expired, not before every request (#470)
Browse files Browse the repository at this point in the history
* fix: Refresh JWT only when expired, not before every request

* resolve new lints
  • Loading branch information
MarquessV authored May 9, 2024
1 parent bb6c76c commit 4f28603
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
26 changes: 12 additions & 14 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ resolver = "2"

[workspace.dependencies]
qcs-api = "0.2.1"
qcs-api-client-common = "0.7.12"
qcs-api-client-grpc = "0.7.14"
qcs-api-client-openapi = "0.8.13"
qcs-api-client-common = "0.7.14"
qcs-api-client-grpc = "0.7.16"
qcs-api-client-openapi = "0.8.15"
serde_json = "1.0.86"
thiserror = "1.0.57"
tokio = "1.36.0"
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
doc-valid-idents = ["gRPC", ".."]
doc-valid-idents = ["gRPC", "..", "JupyterLab"]
2 changes: 1 addition & 1 deletion crates/lib/src/compiler/quilc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub enum CompilationError {
Libquil(crate::compiler::libquil::Error),
/// Errors during compilation when using RPCQ
#[error("compilation error from RPCQ: {0}")]
Rpcq(crate::compiler::rpcq::Error),
Rpcq(rpcq::Error),
}

/// The response from quilc for a `quil_to_native_quil` request.
Expand Down
4 changes: 2 additions & 2 deletions crates/lib/src/qpu/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use std::{fmt, time::Duration};
use cached::proc_macro::cached;
use derive_builder::Builder;
use qcs_api_client_common::configuration::RefreshError;
pub use qcs_api_client_grpc::channel::Error as GrpcError;
#[cfg(feature = "grpc-web")]
use qcs_api_client_grpc::channel::wrap_channel_with_grpc_web;
pub use qcs_api_client_grpc::channel::Error as GrpcError;
use qcs_api_client_grpc::{
channel::{parse_uri, wrap_channel_with, wrap_channel_with_retry},
get_channel_with_timeout,
Expand Down Expand Up @@ -598,7 +598,7 @@ async fn get_accessor(quantum_processor_id: &str, client: &Qcs) -> Result<String
acc.as_ref().and_then(|acc| acc.rank).unwrap_or(i64::MAX)
});

next_page_token = accessors.next_page_token.clone();
next_page_token.clone_from(&accessors.next_page_token);
if next_page_token.is_none() {
break;
}
Expand Down

0 comments on commit 4f28603

Please sign in to comment.