Skip to content

How do I stop a slow polling loop without losing a paid video API job?

A limit on your waiting UI should end its current poll, not delete the saved job. Keep the job ID and resume from the latest state later.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval

Separate two clocks

Set one deadline for this client wait and another review reminder for an unresolved job. An HTTP timeout or short developer wait is not proof that generation failed.

Store state on the server

Keep the returned job ID, last status and last check time. Show the editor how to resume reading that job after closing a tab.

Keep cancellation language accurate

If the public contract has no cancellation operation for that job, describe the action as stopping the wait. Check completion and charge from the real job record.

Pass condition

A user can close and reopen the waiting screen and reach the same job without paying for a new attempt.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation