Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/diskcached.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ def timeout=(t)
@gc_time = t
end

# return true if cache with 'key' is expired
# return true if cache with 'key' is expired or there is no cache entry
def expired? key
return false if timeout.nil?
mtime = read_cache_mtime(key)
return (mtime.nil? || mtime+timeout <= Time.now)
return mtime.nil? || (timeout && mtime+timeout <= Time.now)
end

# expire cache with 'key'
Expand Down