Sha256: 675fa8610a988bcc8fbee1523bc22cf7b9a57aa73daddd57278f82a7347e745b

Contents?: true

Size: 523 Bytes

Versions: 2

Compression:

Stored size: 523 Bytes

Contents

require "redis"

worker_processes 3

# If you set the connection to Redis2 *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 Redis2 after forking the
# worker processes.

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redis2-namespaced-3.0.7.1 examples/unicorn/unicorn.rb
redis2-namespaced-3.0.7 examples/unicorn/unicorn.rb