joshrieken / fist_of_fury

Recurring jobs for Sucker Punch
MIT License
40 stars 4 forks source link

Is there any issues with Passenger? #4

Open MarcosCunhaLima opened 9 years ago

MarcosCunhaLima commented 9 years ago

Apache/Passenger seems to ignore fist_of_fury initialization code and nothing runs at all.

joshrieken commented 9 years ago

Sorry to just get to this.

Is this possibly related to https://github.com/facto/fist_of_fury/issues/2?

MarcosCunhaLima commented 9 years ago

I don't know. I had to give up and now use whenever. It's a shame as in development mode (using Mongrel) it works flawlessly. I couldn't make it work with Passenger/Apache.

0x0badc0de commented 9 years ago

Had the same issue. It appears that generated config/initializers/fist_of_fury.rb is not executed under passenger since Rails::Server is not defined. After reading http://stackoverflow.com/questions/12088025/detect-if-application-was-started-as-http-server-or-not-rake-task-rconsole-etc I've updated my initializer to -if defined?(Rails::Server) +if defined?(Rails::Server) or defined?(::PhusionPassenger) it started working. (but won't under some other servers, see stackoverflow link)

I also had to pass PassengerPreStart option in Apache config otherwise app is not initialized until first request, see https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#PassengerPreStart But then it gets killed in 5 minutes regardless of PassengerMinInstances and PassengerPoolIdleTime values. So finally dropped this module as well :(