Skip to content

Commit

Permalink
validation endpoint checks if connector interface implemented now
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Apr 26, 2024
1 parent 59191c2 commit 6472884
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions nexus/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,6 @@ impl NexusBackend {
}
}

fn is_peer_validity_supported(peer_type: i32) -> bool {
let unsupported_peer_types = [
11, // EVENTHUBS
];
!unsupported_peer_types.contains(&peer_type)
}

async fn check_for_mirror(
catalog: &Catalog,
flow_name: &str,
Expand Down Expand Up @@ -360,16 +353,13 @@ impl NexusBackend {
peer,
if_not_exists: _,
} => {
let peer_type = peer.r#type;
if Self::is_peer_validity_supported(peer_type) {
self.validate_peer(peer).await.map_err(|e| {
PgWireError::UserError(Box::new(ErrorInfo::new(
"ERROR".to_owned(),
"internal_error".to_owned(),
e.to_string(),
)))
})?;
}
self.validate_peer(peer).await.map_err(|e| {
PgWireError::UserError(Box::new(ErrorInfo::new(
"ERROR".to_owned(),
"internal_error".to_owned(),
e.to_string(),
)))
})?;

self.catalog.create_peer(peer.as_ref()).await.map_err(|e| {
PgWireError::UserError(Box::new(ErrorInfo::new(
Expand Down

0 comments on commit 6472884

Please sign in to comment.