mloughran/api_cache — pull request #16 by pw (2014-07-16 05:09:59+00:00)
Title: Fix DalliStore TypeError/Memcached Eviction Bug

In situations where Memcached evicts "#{key}_created_at" but not "key", you get a "TypeError: can't convert nil into an exact number" error from DalliStore#expired? because the value of @dalli.get("#{key}_created_at"), nil, can be subtracted from Time.now in line 32 of dalli_store.rb. This fixes that error by returning true if "#{key}_created_at" doesn't exist. This seems reasonable, since if we don't know the time the key was created, it's only safe to assume it's expired.