rufus-scheduler

Running a cron on start-up using Rufus Scheduler 2.x

拜拜、爱过 提交于 2020-01-24 19:46:07
问题 I'm trying to run a cron on start-up and then midnight every day from that point. I'm bound by Dashing to use Rufus Scheduler 2.0.24, in which I can't use 'first_in' with the cron command. The command in 3.x I want to replicate is like so... scheduler.cron '00 00 * * *', :first_in => '0' do I'm wondering if there is any way around this? I found this which describes a similar issue - but this will only run the cron at the first instance of the specified allotted time and not immediately. 回答1:

Rufus scheduler tasks on heroku running more often than scheduled

随声附和 提交于 2020-01-24 07:03:07
问题 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 I'm at a loss on how to confirm/fix the problem. Has anyone else seen this/know of a solution? Edit: I couldn't resolve the problem with the gem and have moved my app over to the heroku scheduler add on which does not experience this problem. 回答1: The

Why is Rufus scheduling the job twice?

安稳与你 提交于 2020-01-15 09:53:21
问题 Steps to replicate: Create a new Rails project. (rails 3.2.22.5) Add dependencies (warbler, rake, rufus-scheduler) (/Gemfile) JRuby 9.1.7.0 Create new files. (/config/warble.rb) (/web.xml.erb) (/config/intializers/scheduler_rufus.rb) Create an executable war file with jetty webserver. (warble war RAILS_ENV=development) Launch the executable. (java -jar mywar.war) The scheduler runs the job 2 times. /Gemfile: source 'https://rubygems.org' gem 'rails', '3.2.22.5' # Bundle edge Rails instead: #

Why is Rufus scheduling the job twice?

给你一囗甜甜゛ 提交于 2020-01-15 09:52:08
问题 Steps to replicate: Create a new Rails project. (rails 3.2.22.5) Add dependencies (warbler, rake, rufus-scheduler) (/Gemfile) JRuby 9.1.7.0 Create new files. (/config/warble.rb) (/web.xml.erb) (/config/intializers/scheduler_rufus.rb) Create an executable war file with jetty webserver. (warble war RAILS_ENV=development) Launch the executable. (java -jar mywar.war) The scheduler runs the job 2 times. /Gemfile: source 'https://rubygems.org' gem 'rails', '3.2.22.5' # Bundle edge Rails instead: #

Getting extra rufus-scheduler thread with each delayed_job rake jobs:work

狂风中的少年 提交于 2020-01-07 04:10:02
问题 Am trying to use rufus-scheduler to check every minute or so to see if there are jobs ready to be placed in the delayed_job queue. Have an initializer script in #{RAILS_ROOT}/config/initializers that starts the scheduler. Unfortunately the rake jobs:work also runs the rails initialization process so another gets started for each jobs:work started. How can I prevent this? Running ruby 1.8.6.26, rails 2.3.5, dj 1.8.5, rufus-scheduler 2.0.6 on XP pro sp3 回答1: In your initializer, find a way not

Getting extra rufus-scheduler thread with each delayed_job rake jobs:work

丶灬走出姿态 提交于 2020-01-07 04:09:36
问题 Am trying to use rufus-scheduler to check every minute or so to see if there are jobs ready to be placed in the delayed_job queue. Have an initializer script in #{RAILS_ROOT}/config/initializers that starts the scheduler. Unfortunately the rake jobs:work also runs the rails initialization process so another gets started for each jobs:work started. How can I prevent this? Running ruby 1.8.6.26, rails 2.3.5, dj 1.8.5, rufus-scheduler 2.0.6 on XP pro sp3 回答1: In your initializer, find a way not

rufus-scheduler runs scheduler multiple times due to unicorn workers

我只是一个虾纸丫 提交于 2019-12-25 05:06:25
问题 I had setup scheduler in my rails3 projects's /configs/initializers/schedule.rb and it working fine, But it works 2 times and I think it is due to unicorn workers execute schedule at the same time, so it create in my database two records each time. I checked my logic and its ok and enter single record in my local machine. I checked following but not getting idea how to stop multiple unicorn workers to execute scheduler? https://github.com/jmettraux/rufus-scheduler/#advanced-lock-schemes Any

No such file to load — rufus-scheduler

感情迁移 提交于 2019-12-24 11:36:42
问题 I'am developing a plugin in redmine how send mail every days , so i install rufus-scheduler and in my Gemfile i add this line gem "rufus-scheduler " and also i install the gem sudo gem install rufus-scheduler --source http://gemcutter.org and in my redmine/plugins/latest-issues-redmine-plugin/lib/latest_issues/view_hook_listener.rb i do this class LatestIssuesViewHookListener < Redmine::Hook::ViewListener require File.join(File.dirname(__FILE__), '../../app/models/latest_issues_setup')

Where should I put background processes in rails?

痴心易碎 提交于 2019-12-22 12:26:12
问题 I'm building a Rails project that has a cron-type job that I'm managing with Rufus Scheduler. I have two questions about how to set this up appropriately in Rails: Where's the best place to put the job's code? Where should I place the Rufus code to schedule the job? How should I kick it off? 回答1: To control the scheduler I would create a config/initializers/task_scheduler.rb : task_scheduler = Rufus::Scheduler.start_new task_scheduler.every("1m") do Something.to_do! # Do something every

Rufus scheduler not logging in production

天大地大妈咪最大 提交于 2019-12-22 11:24:43
问题 My rails app kicks off a process with rufus-scheduler in an initializer. Here's a stripped-down version of the initializer's code: # config.logger isn't available here, so we have to grab it from the Rails object logger = RAILS_DEFAULT_LOGGER logger.warn(Time.now.to_s + ": Starting Rufus Scheduler") # run every Wednesday at 10 AM cron_string = '0 10 * * 3' scheduler = Rufus::Scheduler.start_new scheduler.cron cron_string do logger.warn(Time.now.to_s + ": Starting Background Process") (do work