Class: GenevaDrive::HousekeepingJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- GenevaDrive::HousekeepingJob
- Defined in:
- lib/geneva_drive/jobs/housekeeping_job.rb
Overview
Job that performs housekeeping tasks for GenevaDrive workflows.
This job handles two main responsibilities:
- Cleanup: Deletes completed/canceled workflows (with their step executions) that are older than the configured threshold.
- Recovery: Recovers stuck step executions that are:
- In "in_progress" state for too long (process crashed)
- In "scheduled" state past their scheduled_for time (job never ran)
Instance Method Summary collapse
-
#perform ⇒ Hash
Performs housekeeping tasks.
Instance Method Details
#perform ⇒ Hash
Performs housekeeping tasks.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/geneva_drive/jobs/housekeeping_job.rb', line 32 def perform results = { workflows_cleaned_up: 0, step_executions_cleaned_up: 0, stuck_in_progress_recovered: 0, stuck_scheduled_recovered: 0 } cleanup_completed_workflows!(results) recover_stuck_step_executions!(results) report_workflow_gauges! logger.info("Completed: #{results}") results end |