Class: OpenLoam::EventLogPruneJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/jobs/open_loam/event_log_prune_job.rb

Overview

Enforces the event log's retention window (OpenLoam::EventLog.prune). Registered per-tenant in OpenLoam::Engine, so it runs inside one tenant and never deletes across the boundary.

Instance Method Summary collapse

Instance Method Details

#perform(tenant_id: nil) ⇒ Object



8
9
10
11
12
13
# File 'app/jobs/open_loam/event_log_prune_job.rb', line 8

def perform(tenant_id: nil)
  tenant = OpenLoam::Tenant.find_by(id: tenant_id)
  return if tenant.nil?

  OpenLoam.as_tenant(tenant) { OpenLoam::EventLog.prune }
end