Skip to content
getgeolens.com

Cleanup Stale Jobs

POST
/jobs/cleanup/stale/
curl --request POST \
--url https://example.com/api/jobs/cleanup/stale/ \
--header 'Authorization: Bearer <token>'

Fail all stale jobs: pending >1h or running >1h.

Ops-only. Not used by the GeoLens UI — invoke from curl/gh api/cron when you need to force-clean orphaned jobs after a worker outage. Equivalent logic runs automatically every 5 minutes via the lifespan sweeper, so this endpoint is only needed if you need cleanup faster than that interval.

Successful Response

Media type application/json
StaleCleanupResponse
object
pending_failed
required
Pending Failed
integer
running_failed
required
Running Failed
integer
total_cleaned
required
Total Cleaned
integer
Example generated
{
"pending_failed": 1,
"running_failed": 1,
"total_cleaned": 1
}

Bad request — invalid query parameters or payload

Unauthorized — missing or invalid credentials

Forbidden — caller lacks access to this resource

Not found

Validation error

Internal server error