instance method
flush_all
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
flush_all()
Flush the cache from all memcache servers.
Source
# File activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb, line 403
def flush_all
raise MemCacheError, 'No active servers' unless active?
raise MemCacheError, "Update of readonly cache" if @readonly
begin
@mutex.lock if @multithread
@servers.each do |server|
begin
sock = server.socket
raise MemCacheError, "No connection to server" if sock.nil?
sock.write "flush_all\r\n"
result = sock.gets
raise_on_error_response! result
result
rescue SocketError, SystemCallError, IOError => err
server.close
raise MemCacheError, err.message
end
end
ensure
@mutex.unlock if @multithread
end
end
Defined in activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb line 403
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in MemCache