Cleanup Stale Jobs
POST
/jobs/cleanup/stale/
const url = 'https://example.com/api/jobs/cleanup/stale/';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”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
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Unauthorized — missing or invalid credentials
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Forbidden — caller lacks access to this resource
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Not found
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Validation error
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}Internal server error
ProblemDetail
object
type
Type
string
title
required
Title
string
status
required
Status
integer
detail
required
Detail
string
Example
{ "type": "about:blank"}