Class: Delayed::Memento
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Delayed::Memento
- Defined in:
- lib/delayed_job_memento/delayed/memento.rb
Instance Method Summary collapse
Instance Method Details
#run_clean_up ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/delayed_job_memento/delayed/memento.rb', line 17 def run_clean_up current_time = Time.zone.now if @@expiration != nil && (@@last_clean_up.nil? || current_time - @@last_clean_up > @@expiration) Delayed::Memento.delete_all(['created_at < ?', current_time - @@expiration]) @@last_clean_up = current_time end end |