PollRange & PollItem: min timeout = 1 sec

This commit is contained in:
Alex 2023-01-11 15:03:08 +01:00
parent bba13f40fc
commit cbfae673e8
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE
2 changed files with 2 additions and 2 deletions

View file

@ -256,7 +256,7 @@ pub(crate) async fn handle_poll_range(
let query = parse_json_body::<PollRangeQuery>(req).await?;
let timeout_msec = query.timeout.unwrap_or(300).clamp(10, 600) * 1000;
let timeout_msec = query.timeout.unwrap_or(300).clamp(1, 600) * 1000;
let resp = garage
.k2v

View file

@ -206,7 +206,7 @@ pub async fn handle_poll_item(
let causal_context =
CausalContext::parse(&causality_token).ok_or_bad_request("Invalid causality token")?;
let timeout_msec = timeout_secs.unwrap_or(300).clamp(10, 600) * 1000;
let timeout_msec = timeout_secs.unwrap_or(300).clamp(1, 600) * 1000;
let item = garage
.k2v