Sha256: 0fb9a2c54cddf8ad9cc1f3f30ec08007db03e9876abca2bca92f19e01df100d7

Contents?: true

Size: 527 Bytes

Versions: 22

Compression:

Stored size: 527 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.disconnect!
end

Version data entries

22 entries across 21 versions & 7 rubygems

Version Path
finsync_redis-3.3.5 examples/unicorn/unicorn.rb
redis-4.0.3 examples/unicorn/unicorn.rb
redis-4.1.0.beta1 examples/unicorn/unicorn.rb
redis-4.0.2 examples/unicorn/unicorn.rb
redis-3.3.5 examples/unicorn/unicorn.rb
redis-4.0.1 examples/unicorn/unicorn.rb
redis-4.0.0 examples/unicorn/unicorn.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/unicorn/unicorn.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/unicorn/unicorn.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/unicorn/unicorn.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/unicorn/unicorn.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/redis-3.3.3/examples/unicorn/unicorn.rb
redis-3.3.3 examples/unicorn/unicorn.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.1/examples/unicorn/unicorn.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.2/examples/unicorn/unicorn.rb
redis-4.0.0.rc1 examples/unicorn/unicorn.rb
redis-3.3.2 examples/unicorn/unicorn.rb
redis-3.3.1 examples/unicorn/unicorn.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/redis-3.3.0/examples/unicorn/unicorn.rb
redis-3.3.0 examples/unicorn/unicorn.rb