lib/circuitbox/memory_store.rb in circuitbox-2.0.0.pre3 vs lib/circuitbox/memory_store.rb in circuitbox-2.0.0.pre4
- old
+ new
@@ -49,11 +49,11 @@
def delete(key)
@mutex.synchronize { @store.delete(key) }
end
- private
+ private
def fetch_container(key)
current_time = current_second
compact(current_time) if @compact_after < current_time
@@ -71,9 +71,10 @@
end
def fetch_value(key)
container = fetch_container(key)
return unless container
+
container.value
end
def compact(current_time)
@store.delete_if { |_, value| value.expired_at?(current_time) }