Class | Rack::MiniProfiler::MemoryStore::CacheCleanupThread |
In: |
lib/mini_profiler/storage/memory_store.rb
|
Parent: | Thread |
Sub-class thread so we have a named thread (useful for debugging in Thread.list).
We don‘t want to hit the filesystem every 10s to clean up the cache so we need to do a bit of accounting to avoid sleeping that entire time. We don‘t want to sleep for the entire period because it means the thread will stay live in hot deployment scenarios, keeping a potentially large memory graph from being garbage collected upon undeploy.