web / lib/jobs/handlers/schema-maintenance-job
lib/jobs/handlers/schema-maintenance-job
Schema Maintenance Job Handler.
This job periodically checks all datasets for stale schemas and regenerates them as needed. It runs on a schedule to keep schemas up-to-date without requiring manual intervention.
Interfaces
SchemaMaintenanceJobInput
Properties
datasetIds?
optionaldatasetIds:number[]
Optional: specific dataset IDs to check (if omitted, checks all)
forceRegenerate?
optionalforceRegenerate:boolean
Optional: force regeneration even if schemas appear fresh
maxDatasets?
optionalmaxDatasets:number
Optional: maximum datasets to process in one run (default: 100)
SchemaMaintenanceResult
Properties
success
success:
boolean
datasetsChecked
datasetsChecked:
number
schemasGenerated
schemasGenerated:
number
schemasSkipped
schemasSkipped:
number
schemasFailed
schemasFailed:
number
duration
duration:
number
details?
optionaldetails:ProcessingResult[]
Variables
schemaMaintenanceJob
constschemaMaintenanceJob:object
Schema maintenance job handler
Type Declaration
slug
slug:
string="schema-maintenance"
schedule
schedule:
object[]
Run daily at 3 AM to check and regenerate stale schemas Cron format: minute hour day month weekday
retries
retries:
number=2
waitUntil
waitUntil:
number=600000
handler()
handler: (
context) =>Promise<{ output: [SchemaMaintenanceResult](#schemamaintenanceresult); }>
Parameters
context
Returns
Promise<{ output: [SchemaMaintenanceResult](#schemamaintenanceresult); }>