Created
July 7, 2016 20:26
-
-
Save anonymous/bc90c9e58a88b0f789ccebf9bf474a29 to your computer and use it in GitHub Desktop.
This file contains 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
nums = nums.map do |n| | |
begin | |
( (m.get( "#{n}") || '').size < 500 ) ? nil : n | |
rescue MemCache::MemCacheError => err | |
raise err if err.message != "Net::ReadTimeout" | |
m = MemCache.new 'localhost' | |
redo | |
end | |
end.compact; nums.size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment