开发者

How do I reconnect to Memcache when forking in rails?

开发者 https://www.devze.com 2022-12-28 04:03 出处:网络
I have a rails 3 application, and a script called by rails runner. This script forks and does some stuff in other processes. I do the proper thing with ActiveRecord before forking, where I disconnect-

I have a rails 3 application, and a script called by rails runner. This script forks and does some stuff in other processes. I do the proper thing with ActiveRecord before forking, where I disconnect-fork-reconnect and all that jazz.

My question is I 开发者_C百科also use memcache for the Rails.cache but should I be disconnecting-reconnecting that too for my forks? If so, how would I go about that in the rails way.


Yes, you should reconnect memcache after the fork. You can see a discussion related to this at the mod_rails documentation.

You can trigger memcache to reconnect

Rails.cache.reset
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号