lib/contrast/agent/assess/tracker.rb in contrast-agent-6.6.5 vs lib/contrast/agent/assess/tracker.rb in contrast-agent-6.7.0

- old
+ new

@@ -10,11 +10,10 @@ # # Finalized objects should run through this class as the Finalizers # have tightly coupled dependencies on each other. class Tracker PROPERTIES_HASH = Contrast::Agent::Assess::Finalizers::Hash.new - KEEP_AGE = 600_000.cs__freeze # 10 minutes class << self # Retrieve the properties of the given Object, iff they exist. # # @param source [Object, nil] the thing for which to look up properties. @@ -58,15 +57,10 @@ end # Clean PROPERTIES_HASH of any values older than KEEP_AGE ms or # have nil properties def cleanup! - PROPERTIES_HASH.delete_if do |_k, properties| - return true if properties.nil? - return false unless (event = properties&.event) - - KEEP_AGE <= (Contrast::Utils::Timer.now_ms - event.time) - end + PROPERTIES_HASH.cleanup! end end end end end