Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion backend/api/src/api/handlers/auth_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ pub async fn google_callback(
let frontend_url =
std::env::var("FRONTEND_URL").unwrap_or_else(|_| "http://localhost:3000".to_string());

let client = reqwest::Client::new();
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| reqwest::Client::new());
let token_res = client
.post("https://oauth2.googleapis.com/token")
.form(&[
Expand Down
5 changes: 4 additions & 1 deletion backend/api/src/services/ai_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ impl AiService {
let model = resolve_model();

Self {
client: Client::new(),
client: Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| Client::new()),
api_keys: Arc::new(api_keys),
model,
next_key_index: Arc::new(AtomicUsize::new(0)),
Expand Down
5 changes: 4 additions & 1 deletion backend/api/src/services/email_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ impl EmailService {
pub fn new(api_key: String) -> Self {
Self {
api_key,
client: Client::new(),
client: Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| Client::new()),
}
}

Expand Down
5 changes: 4 additions & 1 deletion backend/api/src/services/sui_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ impl SuiService {
pub fn new(rpc_repo: RpcRepository, _rpc_url: String) -> Self {
Self {
rpc_repo,
client: Client::new(),
client: Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| Client::new()),
}
}

Expand Down
5 changes: 4 additions & 1 deletion cli/src/chains/aptos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ impl AptosAdapter {
});

Self {
client: Client::new(),
client: Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| Client::new()),
rpc_url: url,
}
}
Expand Down
5 changes: 4 additions & 1 deletion cli/src/chains/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ impl EthereumAdapter {
});

Self {
client: Client::new(),
client: Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| Client::new()),
rpc_url: url,
}
}
Expand Down
5 changes: 4 additions & 1 deletion cli/src/chains/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ impl SolanaAdapter {
});

Self {
client: Client::new(),
client: Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| Client::new()),
rpc_url: url,
}
}
Expand Down
5 changes: 4 additions & 1 deletion cli/src/chains/soroban.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ impl SorobanAdapter {
});

Self {
client: Client::new(),
client: Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| Client::new()),
rpc_url: url,
}
}
Expand Down
5 changes: 4 additions & 1 deletion cli/src/chains/sui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ impl SuiAdapter {
});

Self {
client: Client::new(),
client: Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| Client::new()),
rpc_url: url,
}
}
Expand Down
5 changes: 4 additions & 1 deletion cli/src/cli/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ impl CommandHandler {
password,
};

let client = reqwest::Client::new();
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.unwrap_or_else(|_| reqwest::Client::new());
let api_url =
std::env::var("API_URL").unwrap_or_else(|_| "http://localhost:8000".to_string());

Expand Down
Loading