lib/zache.rb in zache-0.8.0 vs lib/zache.rb in zache-0.9.0
- old
+ new
@@ -121,9 +121,16 @@
rec = nil
end
!rec.nil?
end
+ # Returns the modification time of the key, if it exists.
+ # If not, current time is returned.
+ def mtime(key)
+ rec = @hash[key]
+ rec.nil? ? Time.now : rec[:start]
+ end
+
# Is cache currently locked doing something?
def locked?
@mutex.locked?
end