Skip to content

Commit 8674b1f

Browse files
committed
1 parent d7437fe commit 8674b1f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

crates/interledger-api/src/http_retry.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ impl Client {
5050
// If the account is not found on the peer's connector, the
5151
// retry logic will not get triggered. When the counterparty
5252
// tries to add the account, they will complete the handshake.
53+
54+
let msg = format!("[Engine: {}, Account: {}]", engine_url, id);
5355
let res = FutureRetry::new(
5456
move || {
5557
client
@@ -60,7 +62,7 @@ impl Client {
6062
},
6163
IoHandler::new(
6264
self.max_retries,
63-
format!("[Engine: {}, Account: {}]", engine_url, id),
65+
msg,
6466
),
6567
)
6668
.await?;

crates/interledger-service-util/src/exchange_rate_providers/cryptocompare.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ pub async fn query_cryptocompare(
5151
client: &Client,
5252
api_key: &SecretString,
5353
) -> Result<HashMap<String, f64>, ()> {
54+
// ref: https://github.com/rust-lang/rust/pull/64856
55+
let header = format!("Apikey {}", api_key.expose_secret()).to_string();
5456
let res = client
5557
.get(CRYPTOCOMPARE_URL.clone())
5658
// TODO don't copy the api key on every request
57-
.header(
58-
"Authorization",
59-
format!("Apikey {}", api_key.expose_secret()).as_str(),
60-
)
59+
.header("Authorization", header)
6160
.send()
6261
.map_err(|err| {
6362
error!(

crates/interledger-service-util/src/exchange_rates_service.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ where
258258
);
259259
let interval = async move {
260260
let mut interval = tokio::time::interval(interval);
261-
while let _ = interval.tick().await {
261+
loop {
262+
interval.tick().await;
262263
// Ignore errors so that they don't cause the Interval to stop
263264
let _ = self.update_rates().await;
264265
}
265-
Ok::<(), ()>(())
266266
};
267267
tokio::spawn(interval);
268268
}

0 commit comments

Comments
 (0)