Class: RubyLLM::Agents::RetentionJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- RubyLLM::Agents::RetentionJob
- Defined in:
- lib/ruby_llm/agents/infrastructure/retention_job.rb
Overview
Background job that enforces two-tier data retention on execution records.
Soft pass: for executions older than Configuration#soft_purge_after, destroys the associated execution_details and tool_executions rows, preserves a truncated copy of error_message in metadata, and stamps metadata so the dashboard can surface the state and the pass stays idempotent.
Hard pass: for executions older than Configuration#hard_purge_after, destroys the executions row itself. The foreign-key cascade removes any remaining details or tool_executions.
Either tier may be set to nil in configuration to skip that pass.
Constant Summary collapse
- ERROR_MESSAGE_MAX_LENGTH =
500- BATCH_SIZE =
500
Instance Method Summary collapse
-
#perform ⇒ Hash
Runs the soft and hard retention passes based on current configuration.
Instance Method Details
#perform ⇒ Hash
Runs the soft and hard retention passes based on current configuration.
37 38 39 40 41 42 |
# File 'lib/ruby_llm/agents/infrastructure/retention_job.rb', line 37 def perform { soft_purged: soft_purge, hard_purged: hard_purge } end |