Puma 2.9.2 and rufus-scheduler 3.0.3 incompatibility

576 views Asked by At

I´m using Rufus Scheduler 3.0.3 in a Ruby on Rails 4.1.4 web app and it´s working great with Unicorn. I moved to Puma and it´s great but I have realized Rufus is not working with Puma (daemonized).

I have read this issue #183 (comment) https://github.com/puma/puma/issues/183#issuecomment-59386038 that is closed for an earlier version, but it´s still not working and not clear to me if there is already a fix for it.

I don´t know if there is a workaround in the meantime.

UPDATE: There are not much logs to display, my rufus scheduler tasks are working when running with Unicorn, but If I change the server to Puma, it doesn´t run any automated task on my laptop. Even there is not any log to show.

I just add my current Rufus scheduler file:

task_scheduler.rb:

begin 

  require 'rufus-scheduler'

  scheduler = Rufus::Scheduler.new

  #Secretary responsible for executing events every 60 seconds.
  scheduler.every '60s' do
    Secretary.executeEvents
  end

  # Statistics (Owner) calculation every 1 day.
  scheduler.every '24h' do
    StatisticsCalculator.updateOwnerStatistics
  end
end

Am I missing any configuration?

On the Puma side, I just have this config file config/puma/development.rb with only this:

 stdout_redirect 'log/puma.stdout.log', 'log/puma.stderr.log', true

I don´t set up any workers, etc...

2

There are 2 answers

1
Rober On

Finally, it looks there was an small issue. It has been kindly fixed by the Puma guys.

Please, see: https://github.com/puma/puma/issues/607

2
jmettraux On

No, it works.

I packaged this sample project for you:

https://github.com/jmettraux/for_rober

Rufus-scheduler 3.0.3 schedules just fine with Puma 2.9.2 (Ruby 1.9.3 on Debian GNU/Linux).

Thanks for not blaming other people's work without facts.

If there really is an issue, I suggest you go and read http://www.chiark.greenend.org.uk/~sgtatham/bugs.html, then read it again, three times. It's most surely available in your native language. Then, if you really think rufus-scheduler is the culprit, go and open a detailed issue report at https://github.com/jmettraux/rufus-scheduler/issues Beware posting crappy "it doesn't work" material, it'll earn you only negative reactions.

UPDATE:

I strongly suggest you clone my mini-project on your machine and try it, then report the results here in the comments. The details are in the README.md of the project.

UPDATE:

Roberto is trying to get this issue solved in parallel, directly at https://github.com/puma/puma/issues/607