Skip to content

Commit

Permalink
libsql: sync use auth_token from struct
Browse files Browse the repository at this point in the history
  • Loading branch information
LucioFranco committed Nov 18, 2024
1 parent e43867e commit 8792c39
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions libsql/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl SyncContext {
frame_no + 1
);
let max_frame_no = self
.push_with_retry(uri, &self.auth_token, frame.to_vec(), self.max_retries)
.push_with_retry(uri, frame.to_vec(), self.max_retries)
.await?;

Ok(max_frame_no)
Expand All @@ -41,7 +41,6 @@ impl SyncContext {
async fn push_with_retry(
&self,
uri: String,
auth_token: &Option<String>,
frame: Vec<u8>,
max_retries: usize,
) -> Result<u32> {
Expand All @@ -52,11 +51,10 @@ impl SyncContext {

let mut req = http::Request::post(uri.clone());

match auth_token {
Some(ref auth_token) => {
match &self.auth_token {
Some(auth_token) => {
let auth_header =
http::HeaderValue::try_from(format!("Bearer {}", auth_token.to_owned()))
.unwrap();
http::HeaderValue::try_from(format!("Bearer {}", auth_token)).unwrap();

req.headers_mut()
.expect("valid http request")
Expand Down

0 comments on commit 8792c39

Please sign in to comment.