rufus-scheduler

rufus cron job not working in Apache/Passenger

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 12:14:47
I have a Rails app running on Apache/Passenger. It has a rufus-scheduler cron job that runs in the background and sends out notifications via email. When I am running the app in development on the WEBrick server, the emails are sent like they are supposed to be sent. When I start up the app in production on Apache/Passenger, the emails don't get sent. In the production logs it doesn't show any logs for rufus-scheduler. I'm stuck in this problem. Your help will be appreciated, thank you in advance. The easiest solution is to set PassengerSpawnMethod to direct . The Phusion Passenger

rufus-scheduler and delayed_job on Heroku: why use a worker dyno?

早过忘川 提交于 2019-12-04 07:28:00
I'm developing a Rails 3.2.16 app and deploying to a Heroku dev account with one free web dyno and no worker dynos. I'm trying to determine if a (paid) worker dyno is really needed. The app sends various emails. I use delayed_job_active_record to queue those and send them out. I also need to check a notification count every minute. For that I'm using rufus-scheduler. rufus-scheduler seems able to run a background task/thread within a Heroku web dyno. On the other hand, everything I can find on delayed_job indicates that it requires a separate worker process. Why? If rufus-scheduler can run a

How to get rufus-scheduler working with a Rails app deployed to Heroku?

白昼怎懂夜的黑 提交于 2019-12-03 08:39:28
In ./config/initializers I've created a file called task_scheduler.rb and it contains the following code: require 'rufus-scheduler' require 'mechanize' scheduler = Rufus::Scheduler.new scheduler.every("1h") do puts "Starting Rufus Scheduler - Task 1 - Checking exampleShop for new orders" a = Mechanize.new a.get('http://exampleshop.nl/admin/') do |page| # Select the login form login_form = page.forms.first # Insert the username and password login_form.username = 'username' login_form.password = 'password' # Submit the login information dashboard_page = a.submit(login_form, login_form.buttons

Connection pool issue with ActiveRecord objects in rufus-scheduler

不羁的心 提交于 2019-11-28 07:35:47
I'm using rufus-scheduler to run a number of frequent jobs that do some various tasks with ActiveRecord objects. If there is any sort of network or postgresql hiccup, even after recovery, all the threads will throw the following error until the process is restarted: ActiveRecord::ConnectionTimeoutError (could not obtain a database connection within 5 seconds (waited 5.000122687 seconds). The max pool size is currently 5; consider increasing it. The error can easily be reproduced by restarting postgres. I've tried playing (up to 15) with the pool size, but no luck there. That leads me to

Connection pool issue with ActiveRecord objects in rufus-scheduler

非 Y 不嫁゛ 提交于 2019-11-27 19:19:48
问题 I'm using rufus-scheduler to run a number of frequent jobs that do some various tasks with ActiveRecord objects. If there is any sort of network or postgresql hiccup, even after recovery, all the threads will throw the following error until the process is restarted: ActiveRecord::ConnectionTimeoutError (could not obtain a database connection within 5 seconds (waited 5.000122687 seconds). The max pool size is currently 5; consider increasing it. The error can easily be reproduced by restarting