fix: cap input history per_page to 100 on cloud (#8624)

Prevents excessive memory/query load from large per_page values on the
inputs/history endpoint in cloud environments.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-03-30 18:44:51 +00:00
committed by GitHub
parent 2d27b17a05
commit 8e973c892d

View File

@@ -26,6 +26,7 @@ use windmill_common::{
jobs::JobKind,
scripts::to_i64,
utils::{not_found_if_none, paginate, Pagination},
worker::CLOUD_HOSTED,
};
pub fn workspaced_service() -> Router {
Router::new()
@@ -134,6 +135,11 @@ async fn get_input_history(
Query(g): Query<GetInputHistory>,
) -> JsonResult<Vec<Input>> {
let (per_page, offset) = paginate(pagination);
let per_page = if *CLOUD_HOSTED {
per_page.min(100)
} else {
per_page
};
let mut tx = user_db.begin(&authed).await?;