We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55777f9 commit cc0996dCopy full SHA for cc0996d
theia/proxy-rs/src/db.rs
@@ -19,16 +19,11 @@ pub async fn get_cluster_address(pool: &MySqlPool, session_id: &str) -> Result<S
19
.fetch_optional(pool)
20
.await?;
21
22
- match row {
23
- Some(session) => {
24
- if let Some(cluster_address) = session.cluster_address {
25
- Ok(cluster_address)
26
- } else {
27
- Err(anyhow::anyhow!("cluster address not found"))
28
- }
29
30
- None => Err(anyhow::anyhow!("session not found")),
+ if let Some(row) = row {
+ return row.cluster_address.ok_or_else(|| anyhow::anyhow!("cluster address not found"));
31
}
+
+ Err(anyhow::anyhow!("cluster_address not found"))
32
33
34
pub async fn update_last_proxy_time(session_id: &str, pool: &MySqlPool) -> Result<()> {
0 commit comments