Skip to content

Commit

Permalink
email quotas only apply to top-level job
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Nov 25, 2024
1 parent e81e239 commit dd50815
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/windmill-worker/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ async fn handle_queued_job(
}

#[cfg(any(not(feature = "enterprise"), feature = "sqlx"))]
if job.created_by.starts_with("email-") {
if job.parent_job.is_none() && job.created_by.starts_with("email-") {
let daily_count = sqlx::query!(
"SELECT value FROM metrics WHERE id = 'email_trigger_usage' AND created_at > NOW() - INTERVAL '1 day' ORDER BY created_at DESC LIMIT 1"
).fetch_optional(db).await?.map(|x| serde_json::from_value::<i64>(x.value).unwrap_or(1));
Expand Down

0 comments on commit dd50815

Please sign in to comment.