waitForJob pollInterval is a floor: Sume's hint can only lengthen it

Lowering pollInterval in waitForJob does not poll faster than the server asks. The SDK takes the larger of your interval and next_poll_after_seconds.

4 min readSume
All posts

pollInterval in waitForJob is a minimum gap between status reads, with a 2 second default. If the status payload carries next_poll_after_seconds, the SDK waits for the larger of the two. So setting pollInterval: 500 does not make the SDK poll faster than the server asks, and a hint of 10 seconds beats a 2 second interval.

How the delay is picked

The SDK source says the hint carries queue backoff the client cannot see, so it raises the gap and never shortens it.

Delay chosen per poll (read 2026-10-06)
pollIntervalnext_poll_after_secondsWait
2 s (default)null or missing2 s
2 s55 s
500 ms55 s
10 s510 s

What to tune instead

A lower floor mainly helps short image jobs when the server gives no hint. For video, minutes-long jobs make a fast floor pointless. The default timeout is 20 minutes, which is where to adjust for long work.

import { createSumeClient, waitForJob } from "@sume-com/sdk";

const client = createSumeClient({ apiKey: process.env.SUME_API_KEY! });

const job = await waitForJob(process.argv[2]!, {
  client,
  pollInterval: 5_000, // floor; the server hint can still raise it
  timeout: 30 * 60_000, // 30 minutes instead of the 20 minute default
});
console.log(job.status);

Mind the read budget

Status polls are reads, and the rate limit is per key per minute by plan. A tight floor across many jobs spends that budget faster, so share one interval across the fleet.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume