mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-08 00:03:07 +00:00
refactor: fold check_datatable_connection back into its only caller
The helper was split out so the two connection-test endpoints could share a body. Those endpoints are gone, leaving one caller. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
76c0e8f68c
commit
facabc25e9
@@ -2141,16 +2141,9 @@ async fn test_datatable_connection(
|
||||
require_admin(authed.is_admin, &authed.username)?;
|
||||
|
||||
let db_resource = get_datatable_resource_from_db_unchecked(&db, &w_id, &datatable_name).await?;
|
||||
check_datatable_connection(&db, db_resource).await
|
||||
}
|
||||
|
||||
async fn check_datatable_connection(
|
||||
db: &DB,
|
||||
db_resource: serde_json::Value,
|
||||
) -> JsonResult<DataTableConnectionCheck> {
|
||||
let pg_db: PgDatabase = serde_json::from_value(db_resource)
|
||||
.map_err(|e| Error::internal_err(format!("Failed to parse database credentials: {}", e)))?;
|
||||
let (client, connection) = pg_db.connect(Some(db)).await?;
|
||||
let (client, connection) = pg_db.connect(Some(&db)).await?;
|
||||
let join_handle = tokio::spawn(async move { connection.await });
|
||||
|
||||
// One round trip, no side effects: `has_*_privilege` answers for the
|
||||
|
||||
Reference in New Issue
Block a user