Skip to content

Commit

Permalink
use expires_in if it is set during client initialization with active_…
Browse files Browse the repository at this point in the history
…support
  • Loading branch information
Steven Novotny authored and Steven Novotny committed Nov 30, 2010
1 parent fc2591b commit 3426210
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/active_support/cache/dalli_store23.rb
Expand Up @@ -37,6 +37,7 @@ def initialize(*addresses)

mem_cache_options = options.dup
@namespace = mem_cache_options.delete(:namespace)
@expires_in = mem_cache_options[:expires_in]
@data = self.class.build_mem_cache(*(addresses + [mem_cache_options]))

extend Strategy::LocalCache
Expand Down Expand Up @@ -154,7 +155,7 @@ def stats

# Exists in 2.3.8 but not in 2.3.2 so roll our own version
def expires_in(options)
expires_in = options && options[:expires_in]
expires_in = (options && options[:expires_in]) || @expires_in

raise ":expires_in must be a number" if expires_in && !expires_in.is_a?(Numeric)

Expand Down

0 comments on commit 3426210

Please sign in to comment.