fix: align cfg guards for check_license_key_valid and improve SSE bridge error handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-02-06 14:41:27 +00:00
co-authored by Claude Opus 4.6
parent 755e36b00b
commit ad83be499a
4 changed files with 11 additions and 7 deletions
+7 -3
View File
@@ -151,9 +151,13 @@ impl JobOps for JobOpsImpl {
while let Some(msg) = bridge_rx.recv().await {
let converted = match msg {
crate::jobs::JobUpdateSSEStream::Update(update) => {
JobUpdateSSEStream::Update(
serde_json::to_value(&update).unwrap_or_default(),
)
match serde_json::to_value(&update) {
Ok(v) => JobUpdateSSEStream::Update(v),
Err(e) => {
tracing::error!("Failed to serialize SSE job update: {e}");
continue;
}
}
}
crate::jobs::JobUpdateSSEStream::Error { error } => {
JobUpdateSSEStream::Error { error }
+1 -1
View File
@@ -3849,7 +3849,7 @@ pub fn add_raw_string(
pub use windmill_triggers::jobs_ext::check_tag_available_for_workspace;
#[cfg(feature = "enterprise")]
#[cfg(all(feature = "enterprise", not(feature = "private")))]
pub use windmill_common::ee_oss::check_license_key_valid;
use windmill_common::flows::InputTransform;
+1 -1
View File
@@ -30,7 +30,7 @@ use windmill_queue::PushArgsOwned;
// Re-export shared types/functions from windmill-common
pub use windmill_common::jobs::{delete_job_metadata_after_use, RunJobQuery};
#[cfg(feature = "enterprise")]
#[cfg(all(feature = "enterprise", not(feature = "private")))]
pub use windmill_common::ee_oss::check_license_key_valid;
// Re-export scope helpers from windmill-api-auth
@@ -24,7 +24,7 @@ use windmill_common::{
};
use windmill_queue::{push, PushArgs, PushArgsOwned, PushIsolationLevel};
#[cfg(feature = "enterprise")]
#[cfg(all(feature = "enterprise", not(feature = "private")))]
use crate::jobs_ext::check_license_key_valid;
use crate::jobs_ext::{
check_tag_available_for_workspace, delete_job_metadata_after_use,
@@ -829,7 +829,7 @@ async fn trigger_script_with_retry_and_error_handler(
Option<bool>,
Option<sqlx::Transaction<'static, sqlx::Postgres>>,
)> {
#[cfg(feature = "enterprise")]
#[cfg(all(feature = "enterprise", not(feature = "private")))]
check_license_key_valid().await?;
check_scopes(&authed, || format!("jobs:run:scripts:{script_path}"))?;