Module: PartnerService::Reservations::Exports::ProgressTracker
- Extended by:
- ActiveSupport::Concern
- Includes:
- ExportConstants
- Defined in:
- app/services/partner_service/reservations/exports/progress_tracker.rb
Defined Under Namespace
Modules: ErrorHandler, PerformanceMonitor, PhaseManager, ProgressCalculators
Constant Summary
Constants included from ExportConstants
ExportConstants::CHANNEL_IDS_TO_SKIP, ExportConstants::DEFAULT_QUEUE, ExportConstants::EMAIL_BATCH_SIZE, ExportConstants::ERROR_CATEGORIES, ExportConstants::EXCEL_FILE_EXTENSION, ExportConstants::LARGE_DATASET_WARNING_THRESHOLD, ExportConstants::LONG_PROCESS_DAYS_THRESHOLD, ExportConstants::LONG_PROCESS_QUEUE, ExportConstants::MAX_RETRIES, ExportConstants::PDF_FILE_EXTENSION, ExportConstants::PROGRESS_MESSAGES, ExportConstants::PROGRESS_PHASES, ExportConstants::PROGRESS_UPDATE_BATCH_SIZE, ExportConstants::RESERVATION_BATCH_SIZE, ExportConstants::RETRY_BASE_INTERVAL, ExportConstants::RETRY_MAX_ELAPSED_TIME, ExportConstants::ZERO_COMMISSION_CHANNEL_ID
Instance Method Summary collapse
-
#create_progress_tracker(attachment, job_id = nil) ⇒ TrackingService
Create and initialize export tracker.
-
#progress_tracker ⇒ TrackingService
Get current export tracker.
-
#update_export_progress(percentage, message = nil) ⇒ Object
Update progress with automatic phase detection.
-
#with_progress_tracking(phase, message = nil, error_category = :system_error) { ... } ⇒ Object
Execute block with progress tracking and error handling.
Instance Method Details
#create_progress_tracker(attachment, job_id = nil) ⇒ TrackingService
Create and initialize export tracker
288 289 290 |
# File 'app/services/partner_service/reservations/exports/progress_tracker.rb', line 288 def create_progress_tracker(, job_id = nil) @export_tracker = TrackingService.new(, job_id) end |
#progress_tracker ⇒ TrackingService
Get current export tracker
295 296 297 |
# File 'app/services/partner_service/reservations/exports/progress_tracker.rb', line 295 def progress_tracker @export_tracker end |
#update_export_progress(percentage, message = nil) ⇒ Object
Update progress with automatic phase detection
322 323 324 325 326 |
# File 'app/services/partner_service/reservations/exports/progress_tracker.rb', line 322 def update_export_progress(percentage, = nil) # Determine phase based on percentage phase = determine_phase_from_percentage(percentage) @export_tracker&.update_progress(phase, percentage, ) end |
#with_progress_tracking(phase, message = nil, error_category = :system_error) { ... } ⇒ Object
Execute block with progress tracking and error handling
305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'app/services/partner_service/reservations/exports/progress_tracker.rb', line 305 def with_progress_tracking(phase, = nil, error_category = :system_error) start_phase(phase, ) begin result = yield complete_phase(phase) result rescue StandardError => e @export_tracker&.handle_error(error_category, e., e) raise e end end |