Sha256: 4fd953f87a434796a80e3ad1b40cd6d68c0b619e24a2c77ab6e696e050adea06

Contents?: true

Size: 520 Bytes

Versions: 17

Compression:

Stored size: 520 Bytes

Contents

require "redis"

worker_processes 3

# If you set the connection to Redis *before* forking,
# you will cause forks to share a file descriptor.
#
# This causes a concurrency problem by which one fork
# can read or write to the socket while others are
# performing other operations.
#
# Most likely you'll be getting ProtocolError exceptions
# mentioning a wrong initial byte in the reply.
#
# Thus we need to connect to Redis after forking the
# worker processes.

after_fork do |server, worker|
  Redis.current.quit
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
redis-3.2.1 examples/unicorn/unicorn.rb
redis-3.2.0 examples/unicorn/unicorn.rb
redis-3.1.0 examples/unicorn/unicorn.rb
redis-3.0.7 examples/unicorn/unicorn.rb
redis-3.0.6 examples/unicorn/unicorn.rb
redis-3.0.5 examples/unicorn/unicorn.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/redis-3.0.4/examples/unicorn/unicorn.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/redis-3.0.4/examples/unicorn/unicorn.rb
redis-3.0.4 examples/unicorn/unicorn.rb
redis-3.0.3 examples/unicorn/unicorn.rb
remq-0.0.4 vendor/bundle/gems/redis-3.0.2/examples/unicorn/unicorn.rb
remq-0.0.3 vendor/bundle/gems/redis-3.0.2/examples/unicorn/unicorn.rb
redis-3.0.2 examples/unicorn/unicorn.rb
redis-3.0.1 examples/unicorn/unicorn.rb
redis-3.0.0 examples/unicorn/unicorn.rb
redis-3.0.0.rc2 examples/unicorn/unicorn.rb
gorsuch-redis-3.0.0.rc1 examples/unicorn/unicorn.rb