Project

General

Profile

rufus-scheduler doesn't work on Apache2 server

Added by huang huang over 9 years ago

Dear all,

I setup the rufus-scheduler for receiving emails as tutorial

I run the built-in server for Redmine:

rails server

The rufus-scheduler works as expect.
But when i run with Apache2 server, the rufus-sheduler does't work, I don't know how to debug, everybody can tell me how to do futher?

The rufus-scheduler file as below:

hostname:~$ cat /opt/redmine-3.0.3/config/initializers/scheduler_email_receiving.rb
require 'rubygems'
require 'rake'
require 'rufus-scheduler'

load File.join(Rails.root, 'Rakefile')

ENV['host']='imap.email.net'
ENV['port']='143'
# ENV['ssl']= 'SSL'
ENV['folder'] = 'Inbox'
ENV['move_on_success'] = 'success_box'
ENV['move_on_failure'] = 'failure_box'
ENV['username'] = 'email_name'
ENV['password'] = 'password'

scheduler = Rufus::Scheduler.new
# Check emails every 10 mins
# scheduler.interval '10m' do
#   task = Rake.application['redmine:email:receive_pop3']
#   task.reenable
#   task.invoke
# end
scheduler.interval '10m' do
  task = Rake.application['redmine:email:receive_imap']
  task.reenable
  task.invoke
end

Thanks.


Replies (3)

RE: rufus-scheduler doesn't work on Apache2 server - Added by huang huang over 9 years ago

Fix

need to add "PassengerSpawnMethod direct" to apache config files.

RE: rufus-scheduler doesn't work on Apache2 server - Added by o Guenard over 9 years ago

Huang, Could you give an example of yourt conf file.
Same problem, i saw this solution but don't understand where to set that variable in Apache.
Thanks for that.

RE: rufus-scheduler doesn't work on Apache2 server - Added by luc charpentier over 8 years ago

Hello Guenard,

Just add "PassengerSpawnMethod direct" in /apache2dir/mods-enabled/passenger.conf file

Cheers

    (1-3/3)