views:

68

answers:

1

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 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.

+1  A: 

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
danivovich
Thank you very much good sir!
Daniel Huckstep