aboutsummaryrefslogtreecommitdiff
path: root/src/api/k2v
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-01-11 15:03:08 +0100
committerAlex Auvolat <alex@adnab.me>2023-01-11 15:03:08 +0100
commitcbfae673e83251e988d764d3a29f06f571ba8452 (patch)
tree39eca0bed3d46b8e425ad0458836006b60bf716c /src/api/k2v
parentbba13f40fc2e411347ea83960935b39cedb0a7c4 (diff)
downloadgarage-cbfae673e83251e988d764d3a29f06f571ba8452.tar.gz
garage-cbfae673e83251e988d764d3a29f06f571ba8452.zip
PollRange & PollItem: min timeout = 1 sec
Diffstat (limited to 'src/api/k2v')
-rw-r--r--src/api/k2v/batch.rs2
-rw-r--r--src/api/k2v/item.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/api/k2v/batch.rs b/src/api/k2v/batch.rs
index 844faf89..abc9403c 100644
--- a/src/api/k2v/batch.rs
+++ b/src/api/k2v/batch.rs
@@ -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
diff --git a/src/api/k2v/item.rs b/src/api/k2v/item.rs
index e7385bcc..787a7df3 100644
--- a/src/api/k2v/item.rs
+++ b/src/api/k2v/item.rs
@@ -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