Skip to content

Commit

Permalink
critical channels build on non ee
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Sep 21, 2024
1 parent 50a6f78 commit 9c506a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion backend/windmill-api/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ use axum::{
#[cfg(feature = "enterprise")]
use axum::extract::Query;

#[cfg(feature = "enterprise")]
use windmill_common::ee::{send_critical_alert, CriticalAlertKind, CriticalErrorChannel};
use serde::Deserialize;
use windmill_common::{
ee::{send_critical_alert, CriticalAlertKind, CriticalErrorChannel},
error::{self, JsonResult, Result},
global_settings::{
AUTOMATE_USERNAME_CREATION_SETTING, EMAIL_DOMAIN_SETTING, ENV_SETTINGS,
Expand Down Expand Up @@ -390,13 +391,15 @@ pub async fn create_customer_portal_session(
return Ok(url);
}

#[cfg(feature = "enterprise")]
pub async fn test_critical_channels(
Extension(db): Extension<DB>,
authed: ApiAuthed,
Json(test_critical_channels): Json<Vec<CriticalErrorChannel>>,
) -> Result<String> {
require_super_admin(&db, &authed.email).await?;

#[cfg(feature = "enterprise")]
send_critical_alert(
"Test critical error".to_string(),
&db,
Expand All @@ -406,3 +409,8 @@ pub async fn test_critical_channels(
.await;
Ok("Sent test critical error".to_string())
}

#[cfg(not(feature = "enterprise"))]
pub async fn test_critical_channels() -> Result<String> {
Ok("Critical channels require EE".to_string())
}
2 changes: 1 addition & 1 deletion backend/windmill-common/src/ee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub async fn send_critical_alert(
_error_message: String,
_db: &DB,
_kind: CriticalAlertKind,
channels: Option<Vec<CriticalErrorChannel>>,
_channels: Option<Vec<CriticalErrorChannel>>,
) {
}

Expand Down

0 comments on commit 9c506a8

Please sign in to comment.