Module: LlmCostTracker::Retention

Defined in:
lib/llm_cost_tracker/retention.rb

Constant Summary collapse

DEFAULT_BATCH_SIZE =
5_000

Class Method Summary collapse

Class Method Details

.prune(older_than:, batch_size: DEFAULT_BATCH_SIZE, now: Time.now.utc) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/llm_cost_tracker/retention.rb', line 8

def prune(older_than:, batch_size: DEFAULT_BATCH_SIZE, now: Time.now.utc)
  batch_size = normalized_batch_size(batch_size)
  cutoff = resolve_cutoff(older_than, now)
  require_relative "storage/active_record_backend"

  Storage::ActiveRecordBackend.prune(cutoff: cutoff, batch_size: batch_size)
end