This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
remove_stale_cached_threads!(cache, &block)
private
Remove stale threads from the cache.
# File activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb, line 231
def remove_stale_cached_threads!(cache, &block)
keys = Set.new(cache.keys)
Thread.list.each do |thread|
keys.delete(thread.object_id) if thread.alive?
end
keys.each do |key|
next unless cache.has_key?(key)
block.call(key, cache[key])
cache.delete(key)
end
end