post rebasing fixes
This commit is contained in:
@@ -604,9 +604,13 @@ impl Client {
|
||||
/// Create new instance of `Client` using the provided base url and existing client config
|
||||
pub fn clone_with_new_url(&self, new_url: Url) -> Self {
|
||||
Client {
|
||||
base_url: new_url,
|
||||
base_urls: vec![new_url],
|
||||
current_idx: Arc::new(Default::default()),
|
||||
reqwest_client: self.reqwest_client.clone(),
|
||||
|
||||
front: self.front.clone(),
|
||||
retry_limit: self.retry_limit,
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
request_timeout: self.request_timeout,
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
sqlite3 -init settings.sql /Users/jedrzej/workspace/nym/target/debug/build/nym-api-10a9906acce21392/out/nym-api-example.sqlite
|
||||
sqlite3 -init settings.sql /Users/jedrzej/workspace/nym/target/debug/build/nym-api-4b7e804a8ee69b15/out/nym-api-example.sqlite
|
||||
@@ -26,6 +26,7 @@ pub struct NymApisClient {
|
||||
}
|
||||
|
||||
struct InnerClient {
|
||||
// NOTE: this was implemented before the internal http client supported multiple URLs
|
||||
active_client: NymApiClient,
|
||||
available_urls: Vec<Url>,
|
||||
shutdown_token: ShutdownToken,
|
||||
@@ -122,7 +123,10 @@ impl InnerClient {
|
||||
{
|
||||
let broadcast_fut =
|
||||
stream::iter(self.available_urls.clone()).for_each_concurrent(None, |url| {
|
||||
let nym_api = self.active_client.nym_api.clone_with_new_url(url.clone());
|
||||
let nym_api = self
|
||||
.active_client
|
||||
.nym_api
|
||||
.clone_with_new_url(url.clone().into());
|
||||
let req_fut = req(nym_api, request_body);
|
||||
async move {
|
||||
if let Err(err) = req_fut.await {
|
||||
@@ -168,7 +172,10 @@ impl InnerClient {
|
||||
.skip(last_working)
|
||||
.chain(self.available_urls.iter().enumerate().take(last_working))
|
||||
{
|
||||
let nym_api = self.active_client.nym_api.clone_with_new_url(url.clone());
|
||||
let nym_api = self
|
||||
.active_client
|
||||
.nym_api
|
||||
.clone_with_new_url(url.clone().into());
|
||||
|
||||
let timeout_fut = sleep(timeout_duration);
|
||||
let query_fut = req(nym_api);
|
||||
|
||||
Reference in New Issue
Block a user