Maintenance Jobs
Background jobs registered in apps/api/services/maintenance/ and executed by the API on its maintenance tick; the scheduler service polls the tick endpoint on the configured interval. Live state is available under Settings → Maintenance in the UI.
Intervals below are the defaults; each is configurable through its HEGEMONY_MAINTENANCE_* environment variable (see the environment variable reference), and an interval of 0 disables the job (negative values are rejected by settings validation). Every job run takes a lease of 600 s (default) so exactly one instance runs at a time.
| Job | Default interval | What it does |
|---|---|---|
run_status_sync | 300 s | Reconciles stale non-terminal run rows with Temporal workflow state. |
approval_timeouts | 300 s | Expires pending approval requests whose configured timeout elapsed. |
stale_monitors | 300 s | Stops monitor rows whose parent run is already terminal. |
run_event_pruning | 0 s | Deletes old run events for terminal runs after the retention window. |
platform_sync_export | 300 s | Runs scheduled platform sync export for due BACKUP/BIDIRECTIONAL profiles. |
platform_sync_drift_plan | 900 s | Runs scheduled platform sync drift planning for due MIRROR/BIDIRECTIONAL profiles. |
platform_sync_auto_apply | 0 s | Applies latest eligible non-destructive scheduler plans for auto-apply profiles. |
inventory_provider_sync | 60 s | Refreshes external inventory providers whose per-provider sync interval has elapsed, after releasing sync claims whose lease expired. |
file_repository_backfill | 3600 s | Ensures every active organization has its internal file repository provisioned and the bundled object store has its buckets. |
sandbox_image_pruning | 21600 s | Reclaims dangling images and build cache on the container sandbox daemon. |
audit_log_retention | 86400 s | Deletes audit log entries older than HEGEMONY_AUDIT_RETENTION_DAYS in bounded batches; no-op while unset. |
inventory_sync_history_retention | 86400 s | Deletes inventory sync history rows older than HEGEMONY_INVENTORY_SYNC_HISTORY_RETENTION_DAYS in bounded batches, keeping each provider's newest runs and any running row. |