critical channels build on non ee

This commit is contained in:
Ruben Fiszel
2024-09-21 14:43:27 +02:00
parent 50a6f789fa
commit 9c506a83cb
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -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,
@@ -390,6 +391,7 @@ 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,
@@ -397,6 +399,7 @@ pub async fn test_critical_channels(
) -> Result<String> {
require_super_admin(&db, &authed.email).await?;
#[cfg(feature = "enterprise")]
send_critical_alert(
"Test critical error".to_string(),
&db,
@@ -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())
}
+1 -1
View File
@@ -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>>,
) {
}