diff --git a/lib/mini_profiler/storage/memory_store.rb b/lib/mini_profiler/storage/memory_store.rb index 63475761..25bd05d2 100644 --- a/lib/mini_profiler/storage/memory_store.rb +++ b/lib/mini_profiler/storage/memory_store.rb @@ -10,11 +10,11 @@ class MemoryStore < AbstractStore class CacheCleanupThread < Thread def initialize(interval, cycle, store) - super @store = store @interval = interval @cycle = cycle @cycle_count = 1 + super end def should_cleanup? @@ -78,7 +78,7 @@ def initialize_cleanup_thread(args = {}) cleanup_cycle = args.fetch(:cleanup_cycle) { CLEANUP_CYCLE } t = CacheCleanupThread.new(cleanup_interval, cleanup_cycle, self) do until Thread.current[:should_exit] do - t.sleepy_run + Thread.current.sleepy_run end end at_exit { t[:should_exit] = true }