Skip to content

Commit

Permalink
CHG cleanup db helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
synoet committed May 10, 2024
1 parent 55777f9 commit cc0996d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions theia/proxy-rs/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,11 @@ pub async fn get_cluster_address(pool: &MySqlPool, session_id: &str) -> Result<S
.fetch_optional(pool)
.await?;

match row {
Some(session) => {
if let Some(cluster_address) = session.cluster_address {
Ok(cluster_address)
} else {
Err(anyhow::anyhow!("cluster address not found"))
}
}
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"));
}

Err(anyhow::anyhow!("cluster_address not found"))
}

pub async fn update_last_proxy_time(session_id: &str, pool: &MySqlPool) -> Result<()> {
Expand Down

0 comments on commit cc0996d

Please sign in to comment.