Hello Marcus,
this reminds me of
http://groups.google.com/group/rufus-ruby/browse_frm/thread/3583f4a29820e673
There is an interest for passenger...
I'm installing passenger right now.
I was wondering what happens on your passenger with things like :
---8<---
Thread.new do
ActiveRecord::Base.logger.info("Doctor Schweizer, it's now #{Time.now}")
sleep 15
end
--->8---
Let's also have a look at the passenger mailing lists.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
So, I installed passenger and created an app with this initializer :
---8<---
ActiveRecord::Base.logger.info("scheduling...")
Thread.new do
ActiveRecord::Base.logger.info("it's #{Time.now}")
sleep 10
end
ActiveRecord::Base.logger.info("scheduled...")
--->8---
"ing" and "ed" appeared in the log, but then nothing else.
Passenger seems to simply disregards Ruby threads.
I had the same result with Passenger + Ruby Enterprise Edition.
I then tried this :
---8<---
ActiveRecord::Base.logger.info("scheduling...")
Thread.abort_on_exception = true
begin
Thread.new do
ActiveRecord::Base.logger.info("it's #{Time.now}")
sleep 10
end
rescue Exception => e
ActiveRecord::Base.logger.info("scheduling failed\n#{e}")
end
ActiveRecord::Base.logger.info("scheduled...")
--->8---
Same result, "scheduling...\nscheduled..." and nothing more.
I guess you'll have to rely on cron and at for your scheduling. Have a
look at this nice project :
http://github.com/javan/whenever/
Passenger is great BTW.