lib/active_support/cache/gibson_store.rb in gibson-1.2.0 vs lib/active_support/cache/gibson_store.rb in gibson-1.2.1
- old
+ new
@@ -19,32 +19,51 @@
extend Strategy::LocalCache
end
# Deletes all items from the cache.
def clear(options = nil)
- @gibson.mdel @namespace + "::"
+ begin
+ @gibson.mdel @namespace + "::"
+ rescue
+ 0
+ end
end
# Increments an already existing integer value that is stored in the cache.
def increment(name, amount = 1, options = nil)
key = expand_key(name)
- amount.times do |v|
- @gibson.inc key
+
+ begin
+ amount.times do |v|
+ @gibson.inc key
+ end
+ rescue
+
end
end
# Decrements an already existing integer value that is stored in the cache.
def decrement(name, amount = 1, options = nil)
key = expand_key(name)
- amount.times do |v|
- @gibson.dec key
+
+ begin
+ amount.times do |v|
+ @gibson.dec key
+ end
+ rescue
+
end
end
# Deletes multiple values by expression
def delete_matched(matcher, options = nil)
key = expand_key(matcher)
- @gibson.mdel key
+
+ begin
+ @gibson.mdel key
+ rescue
+ 0
+ end
end
# Returns some stats
def stats
@gibson.stats