Questions tagged [rufus-scheduler]

rufus-scheduler is a job scheduler for Ruby (at, cron, in, every and interval jobs). It's not a substitute for cron, it's just a small in-process scheduler.

Rufus-scheduler is a job scheduler for Ruby (at, cron, in, every and interval jobs).

It's not a substitute for cron, it's just a small in-process scheduler.

The source (and the README) is available at https://github.com/jmettraux/rufus-scheduler

If you need help, make sure to read: help_help.md

189 questions
16
votes
3 answers

Connection pool issue with ActiveRecord objects in rufus-scheduler

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…
ericvg
  • 3,907
  • 1
  • 30
  • 35
14
votes
3 answers

How to check for a running process with Ruby?

I use a scheduler (Rufus scheduler) to launch a process called "ar_sendmail" (from ARmailer), every minute. The process should NOT be launched when there is already such a process running in order not to eat up memory. How do I check to see if this…
TomDogg
  • 3,803
  • 5
  • 33
  • 60
9
votes
1 answer

Rufus scheduler running multiple times with unicorn, fixed with :lockfile, but how to eliminate the error msg?

scheduler = Rufus::Scheduler.new :lockfile => ".rufus-scheduler.lock" scheduler.every("60") do ... end Environment: Ubuntu, rails 4, rufus, unicorn, nginx Unicorn has multiple workers, so the above 'every' task will be executed multiple times…
user3618929
  • 143
  • 2
  • 6
6
votes
3 answers

Best way to not run rufus-scheduler when starting a rails console

I use rufus-scheduler to run some periodic tasks, but they are extremely annoying to have in the rails console when I just want to test things. Is there an easy way to stop all rufus-scheduler tasks when starting a console automatically? In the…
Kalendae
  • 2,256
  • 1
  • 21
  • 23
6
votes
1 answer

Massive scheduling in Ruby

I need a scheduler for large dynamic collections of tasks. At the moment I'm looking at resque-scheduler, rufus-scheduler, and clockwork. I'll be grateful for advice on choosing which one (or what alternative) to use. Some details: There is a large…
Alex Musayev
  • 635
  • 10
  • 20
6
votes
4 answers

Ruby on rails scheduled tasks

This is my first time scheduling a task and I am not sure of the best implementation (or the proper implementation). My Goal: I have a ruby on rails 4 app setup with twilio and deployed on Heroku. I want the app to automatically text all of my…
stecd
  • 1,681
  • 6
  • 19
  • 28
5
votes
1 answer

Rufus scheduler implementation in rails 3

I have an app running with apache + passenger in production. Currently I initialize the rufus scheduler in a initializer and register jobs reading from a db in that initializer. Way apache/passenger works is that it creates multiple process/instance…
ed1t
  • 8,719
  • 17
  • 67
  • 110
5
votes
1 answer

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

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…
Mark Berry
  • 17,843
  • 4
  • 58
  • 88
4
votes
1 answer

Rufus scheduler tasks on heroku running more often than scheduled

I have a Rails app running on heroku with Rufus Scheduler added on. A 'once a day' task in the scheduler is running more often than once a day. My guess would be something to do with the heroku app running on different dynos during the day, but…
T C
  • 1,337
  • 1
  • 12
  • 21
4
votes
1 answer

How to implement rufus-scheduler in Rails?

The schedule is running but errors "undefined method 'do_something'". What is not right? Using rails 3. In config/initializers/task_scheduler.rb: require 'rubygems' require 'rufus/scheduler' scheduler =…
B Seven
  • 44,484
  • 66
  • 240
  • 385
4
votes
3 answers

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

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 -…
narzero
  • 2,199
  • 5
  • 40
  • 73
4
votes
2 answers

Undefined method `haml' when rendering haml in Pony mail from scheduled job

I have a sinatra app that executes cucumber tests and sends email notification with their results. Email gem is Pony, and there is a haml template for this notification. This logic works within a route: require 'sinatra' require 'haml' require…
Nikita Barsukov
  • 2,957
  • 3
  • 32
  • 39
3
votes
2 answers

what's the difference between rufus-scheduler and a cron?

https://github.com/jmettraux/rufus-scheduler states that: rufus-scheduler is a Ruby gem for scheduling pieces of code (jobs). It understands running a job AT a certain time, IN a certain time, EVERY x time or simply via a CRON…
corroded
  • 21,406
  • 19
  • 83
  • 132
3
votes
1 answer

Rufus-scheduler scheduling twice despite using locks

I'm well aware why this is happening (two ruby runtimes) and that this is a common problem for people who have not read the RS FAQ or searched on SO for this before, but I've spent a couple days trying many prescribed solutions yet my…
Kevin K.
  • 57
  • 1
  • 11
3
votes
1 answer

Sidekiq::Cron::Job throw me uninitialized constant Rufus::Scheduler::CronLine error

I am using Ruby on Rails 5.2.0 to develop a system and I need to run a job every 2 minute. I'm using sidekiq for background processing and sidekiq-cron for scheduling jobs. I execute the following line in rails console: job=Sidekiq::Cron::Job.new(…
1
2 3
12 13