aboutsummaryrefslogtreecommitdiff
path: root/src/api/k2v/item.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-01-10 15:22:25 +0100
committerAlex Auvolat <alex@adnab.me>2023-01-10 15:22:25 +0100
commitb83517d521b1bea7585ce45a803fad373f28225c (patch)
tree5562397a39647be8d61a9c870103d15c604e09ad /src/api/k2v/item.rs
parent57eabe787948ad6c23eae7761d02545c675bf7ff (diff)
downloadgarage-b83517d521b1bea7585ce45a803fad373f28225c.tar.gz
garage-b83517d521b1bea7585ce45a803fad373f28225c.zip
Implement PollRange API endpoint
Diffstat (limited to 'src/api/k2v/item.rs')
-rw-r--r--src/api/k2v/item.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/api/k2v/item.rs b/src/api/k2v/item.rs
index 9b78bc07..ebf34723 100644
--- a/src/api/k2v/item.rs
+++ b/src/api/k2v/item.rs
@@ -208,6 +208,8 @@ 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 item = garage
.k2v
.rpc
@@ -216,7 +218,7 @@ pub async fn handle_poll_item(
partition_key,
sort_key,
causal_context,
- timeout_secs.unwrap_or(300) * 1000,
+ timeout_msec,
)
.await?;