Class: Jobs::CleanUpEmailLogs
- Defined in:
- app/jobs/scheduled/clean_up_email_logs.rb
Instance Method Summary collapse
Methods inherited from Scheduled
Methods inherited from Base
acquire_cluster_concurrency_lock!, clear_cluster_concurrency_lock!, cluster_concurrency, cluster_concurrency_redis_key, delayed_perform, #error_context, get_cluster_concurrency, #last_db_duration, #log, #perform, #perform_immediately
Instance Method Details
#execute(args) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'app/jobs/scheduled/clean_up_email_logs.rb', line 7 def execute(args) return if SiteSetting.delete_email_logs_after_days <= 0 threshold = SiteSetting.delete_email_logs_after_days.days.ago EmailLog.where("created_at < ?", threshold).delete_all SkippedEmailLog.where("created_at < ?", threshold).delete_all end |