Class: Raif::RepairInferenceCostEventsJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/raif/repair_inference_cost_events_job.rb

Overview

Self-healing for inference cost events: creates events for terminal Raif::ModelCompletion records that are missing one. Enqueued whenever a live sync fails (see Raif::ModelCompletion#sync_inference_cost_event, which never fails the completion save); hosts may also schedule it periodically as a safety net.

Idempotent: runs the same scope and sync path as Raif::InferenceCostEvent.backfill!, so concurrent or repeated runs converge on one event per terminal completion.

Instance Method Summary collapse

Instance Method Details

#perform(batch_size: 500) ⇒ Object



22
23
24
# File 'app/jobs/raif/repair_inference_cost_events_job.rb', line 22

def perform(batch_size: 500)
  Raif::InferenceCostEvent.backfill!(batch_size: batch_size)
end