Class: Maintenance::WebhookMaintenance
- Inherits:
-
BaseService
- Object
- BaseService
- Maintenance::WebhookMaintenance
- Defined in:
- app/services/maintenance/webhook_maintenance.rb
Overview
Cleans up stale WebhookLog entries that will never receive a callback.
Three operations, run daily:
- Times out pending entries older than 24h (pending → exception via timeout!)
- Fails processing entries stuck for >2h (processing → exception via fail!)
- Deletes terminal entries (exception/processed/archived) older than 90 days
The StaleTranscriptionRecoveryWorker handles AssemblyAI-specific recovery
(checking their API, retrying). This service is the blunt safety net that
sweeps up anything left behind by any provider.
Constant Summary collapse
- PENDING_TIMEOUT =
24.hours
- PROCESSING_TIMEOUT =
2.hours
- DELETE_AGE =
90.days
- BATCH_LIMIT =
500
Instance Method Summary collapse
Methods inherited from BaseService
#initialize, #log_debug, #log_error, #log_info, #log_warning, #logger, #options, #tagged_logger
Constructor Details
This class inherits a constructor from BaseService
Instance Method Details
#process ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/maintenance/webhook_maintenance.rb', line 26 def process stats = { timed_out: timeout_stale_pending, unstuck: fail_stuck_processing, deleted: delete_old_terminal } log_info "Webhook maintenance complete — #{stats.inspect}" stats end |