Method: Contrast::Agent::Assess::Finalizers::Hash#cleanup!

Defined in:
lib/contrast/agent/assess/finalizers/hash.rb

#cleanup!Object



103
104
105
106
107
108
109
# File 'lib/contrast/agent/assess/finalizers/hash.rb', line 103

def cleanup!
  ids = keys.dup
  ids.each do |key|
    properties = fetch(key.__id__, nil)
    delete(key) unless properties&.event && (Contrast::Utils::Timer.now_ms - properties.event.time) < KEEP_AGE
  end
end