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:
@@ -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?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user