Skip to content

Instantly share code, notes, and snippets.

@tjchambers
Created October 29, 2013 12:05
Show Gist options
  • Save tjchambers/7213452 to your computer and use it in GitHub Desktop.
Save tjchambers/7213452 to your computer and use it in GitHub Desktop.
Code to create dalli down error
require 'dalli'
memcache ||= Dalli::Client.new
a = :dalli_store, '127.0.0.1',
{:namespace => lambda {
generation = $memcache.incr 'mv|' + Rails.env, 1, 0, 1
"#{generation.to_s}.#{Time.now.strftime('%j')}"
}}
memcache.incr 'test',0,0,0
memcache.incr 'test'
memcache.incr 'test'
memcache.incr 'test',0,0,'bad'
sleep(5)
memcache.incr 'test'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment