Closed bcavileer closed 7 years ago
I was thinking of a change like this https://github.com/holmansv/readthis/commit/2698143da9620e6c1c0a9884dd8f332649703052
But I'm not sure how ReadThis gets initialized when set as Rails cache_store, and how to set this after bootup?
The pool's connections are established lazily and will be automatically reconnected after forking.
I've written a bit about how it is undesirable to explicitly re-establish the pool after forking: http://sorentwo.com/2015/08/25/managing-redis-reconnections-from-ruby.html
So, good news, you don't need to do anything =)
Thank you!!
On Mon, Jul 3, 2017, 12:36 PM Parker Selbert notifications@github.com wrote:
The pool's connections are established lazily https://github.com/mperham/connection_pool/blob/master/lib/connection_pool/timed_stack.rb#L12 and will be automatically reconnected after forking.
I've written a bit about how it is undesirable to explicitly re-establish the pool after forking: http://sorentwo.com/2015/08/25/managing-redis-reconnections-from-ruby.html
So, good news, you don't need to do anything =)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sorentwo/readthis/issues/54#issuecomment-312690053, or mute the thread https://github.com/notifications/unsubscribe-auth/AAF5BvT92op_4yxbU8pvFCFMt85SvGDTks5sKRh6gaJpZM4OLWTa .
If I configure this in my config/production.rb
How can I set it's connection pool later when my puma workers call on_worker_boot
on_worker_boot is called after config/production.rb
The pool for readthis cannot be passed in via options
https://github.com/sorentwo/readthis/blob/master/lib/readthis/cache.rb#L59
I am stuck. Before I start hacking and making a mess I thought I'd ask here if I'm on the right track?
https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
https://devcenter.heroku.com/articles/concurrency-and-database-connections#threaded-servers