Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Normalize wait value to nonzero integer
  • Loading branch information
mattt committed Sep 25, 2024
commit 0c0245d7feb8daf2d337de46825031e0840863a4
3 changes: 2 additions & 1 deletion lib/predictions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ async function createPrediction(options) {
const headers = {};
if (wait) {
if (typeof wait === "number") {
headers["Prefer"] = `wait=${wait}`;
const n = Math.max(1, Math.ceil(Number(wait)) || 1);
headers["Prefer"] = `wait=${n}`;
} else {
headers["Prefer"] = "wait";
}
Expand Down