instance method
cleanup
Ruby on Rails 7.1.6
Since v3.0.20Signature
cleanup(options = nil)
Preemptively iterates through all stored keys and removes the ones which have expired.
Parameters
-
optionsopt = nil
Source
# File activesupport/lib/active_support/cache/memory_store.rb, line 101
def cleanup(options = nil)
options = merged_options(options)
_instrument(:cleanup, size: @data.size) do
keys = synchronize { @data.keys }
keys.each do |key|
entry = @data[key]
delete_entry(key, **options) if entry && entry.expired?
end
end
end
Defined in activesupport/lib/active_support/cache/memory_store.rb line 101
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::MemoryStore