Skip to content
getgeolens.com

Cleanup Stale Jobs

POST
/jobs/cleanup/stale/
curl --request POST \
--url https://example.com/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
local_files_reaped
required
Local Files Reaped
integer
pending_failed
required
Pending Failed
integer
running_failed
required
Running Failed
integer
staged_cleanup_failures
required
Staged Cleanup Failures
integer
staged_paths_considered
required
Staged Paths Considered
integer
staged_paths_skipped
required
Staged Paths Skipped
integer
storage_objects_reaped
required
Storage Objects Reaped
integer
terminal_jobs_purged
required
Terminal Jobs Purged
integer
total_affected
required
Total Affected
integer
total_cleaned
required
Total Cleaned
integer
vrt_assets_recovered
required
Vrt Assets Recovered
integer
vrt_generations_failed
required
Vrt Generations Failed
integer
Example generated
{
"local_files_reaped": 1,
"pending_failed": 1,
"running_failed": 1,
"staged_cleanup_failures": 1,
"staged_paths_considered": 1,
"staged_paths_skipped": 1,
"storage_objects_reaped": 1,
"terminal_jobs_purged": 1,
"total_affected": 1,
"total_cleaned": 1,
"vrt_assets_recovered": 1,
"vrt_generations_failed": 1
}

Bad request — invalid query parameters or payload

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks access to this resource

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}