Created
December 13, 2015 04:47
-
-
Save eagletmt/31b5bad78238b64279bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'dalli' | |
dalli = Dalli::Client.new('127.0.0.1:11211') | |
dalli.set('valid_ttl', 'value', 100) | |
p dalli.get('valid_ttl') # "value" | |
dalli.set('invalid_ttl', 'value', 'Invalid TTL') | |
p dalli.get('invalid_ttl') # "No server available" error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/ring.rb:45:in `server_for_key': No server available (Dalli::RingError) | |
from /home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/client.rb:349:in `perform' | |
from /home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/client.rb:123:in `set' | |
from pr547.rb:8:in `<main>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"value" | |
E, [2015-12-13T13:46:22.584782 #24648] ERROR -- : Unexpected exception during Dalli request: ArgumentError: comparison of String with 2592000 failed | |
E, [2015-12-13T13:46:22.584871 #24648] ERROR -- : /home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/server.rb:487:in `>' | |
/home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/server.rb:487:in `sanitize_ttl' | |
/home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/server.rb:287:in `set' | |
/home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/server.rb:67:in `request' | |
/home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/options.rb:18:in `block in request' | |
/usr/lib/ruby/2.3.0/monitor.rb:213:in `mon_synchronize' | |
/home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/options.rb:17:in `request' | |
/home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/client.rb:350:in `perform' | |
/home/eagletmt/.ghq/github.com/mperham/dalli/lib/dalli/client.rb:123:in `set' | |
pr547.rb:8:in `<main>' | |
W, [2015-12-13T13:46:22.584941 #24648] WARN -- : 127.0.0.1:11211 is down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment