poll_paddle_job: Poll a PaddleOCR job until completion

View source: R/poll.R

poll_paddle_jobR Documentation

Poll a PaddleOCR job until completion

Description

Repeatedly queries the job status endpoint until the job reaches "done" or "failed" state, or the maximum wait time is exceeded.

Usage

poll_paddle_job(
  job_id,
  token = "",
  job_url = "",
  poll_interval = 5,
  max_wait_seconds = 3600
)

Arguments

job_id

The job ID returned by submit_paddle_job.

token

PaddleOCR API bearer token. If empty, reads from the PADDLE_OCR_TOKEN environment variable.

job_url

PaddleOCR API endpoint. Defaults to the official cloud URL.

poll_interval

Seconds between status checks (default: 5).

max_wait_seconds

Maximum total wait time in seconds (default: 3600).

Value

A character string containing the JSONL result URL.

Examples

## Not run: 
job_id <- submit_paddle_job("document.png", token = "your_token")
jsonl_url <- poll_paddle_job(job_id, token = "your_token")

## End(Not run)

PaddleOCR documentation built on Aug. 30, 2026, 5:07 p.m.