In the initial method of
, max_prune_time
can be passed as an option.
What is its purpose?
In addition, @max_prune_time = options [max_prune_time] || 2
What is the default unit? Seconds?
max_prune_time
Maximum time in seconds is memory, by removing old entries Store goes out of memory View the implementation of sorting
method for details:
DRP cut (target_size, max_time = zero) # ... start_time = time. No cleaning tools (: sorting, target_size ,: from = & gt; @cache_size) = synchronize {@ key_access.keys.sort {| A, b @key_access [a] .to_f & lt; = & Gt; @key_access [b] .to_f}} key.Each | Key | Delete_entry (key, option) if @cache_size & lt; = Target_size || (Maximum_time & time.Now - start_time & gt; maximum_time) end-end # ... end
No comments:
Post a Comment