Method: AsyncStorage::Allocator#stale?

Defined in:
lib/async_storage/allocator.rb

#stale?NilClass, Boolean

Check if object with a given key is stale

Returns:

  • (NilClass, Boolean)

    Return nil if the object does not exist or true/false according to the object freshness state



130
131
132
133
134
# File 'lib/async_storage/allocator.rb', line 130

def stale?
  breaker.run(fallback: -> { false }) do
    connection { |redis| redis.exists?(naming.body) && redis.ttl(naming.head) < 0 }
  end
end