resque

Restart failed jobs of a specific worker in resque

烈酒焚心 提交于 2019-12-13 00:23:17
问题 I have about 5 queues running in my application. I am not interested in restarting all the failed jobs. I just want to restart the failed jobs that belong to one worker. I am using Resque with rails. I see an option to "Retry failed Jobs" in /resque page. But, How do I restart the failed jobs that belong to one worker? 回答1: I have found those articles about your question Resque: how to requeue failed jobs and Resque: automatically kill stuck workers and retry failed jobs 来源: https:/

Enqueue_at(..) error in rails app. Resque scheduler raises NoQueueError

独自空忆成欢 提交于 2019-12-12 18:24:09
问题 I keep getting this error while trying to use ResqueScheduler enqueue_at Resque::NoQueueError in QuestionsController#create Jobs must be placed onto a queue. Here is the class that's calling it: note the after_create callback. The reason the error is raised in the Questions controller is because there is a callback on_create for Question which in turn, creates an Assignment for users. This is a follow-up issue from this post: Strange behavior with a resque scheduler job I've tried to follow

How to push job in specific queue and limit number workers with sidekiq?

筅森魡賤 提交于 2019-12-12 10:45:57
问题 I know we can do: sidekiq_options queue: "Foo" But in this case it's the Worker which is assigned to only one queue: "Foo". I need to assign a Job (and not a Worker) in specific queue. With Resque it's easy: Resque.enqueue_to(queue_name, my_job) Further, for concurrency problem, i need to limit the number of Worker on each queue at 1. How can I do this? 回答1: You might use https://github.com/brainopia/sidekiq-limit_fetch and then: Sidekiq::Client.push({ 'class' => GuidePdfWorker, 'queue' =>

Solutions for resque failover redis

。_饼干妹妹 提交于 2019-12-12 09:06:15
问题 Since clustered Redis is still in the works, are there mechanisms in Resque that automatically will failover to a Redis slave should the master ever go down? 回答1: I don't think so. However, you can implement the master election mechanism yourself quite easily using Apache Zookeeper: require "rubygems" require "zookeeper" def log(msg) puts "[#{Process.pid}] #{msg}" end def debug(obj) log(obj.inspect) end def on_master_changed(&block) loop do wcb = Zookeeper::WatcherCallback.new resp =

Resque: one worker per queue

最后都变了- 提交于 2019-12-12 07:58:01
问题 I currently have a Rails 3.0 project, with Ruby 1.9.2 and Resque. My application has multiple worker classes and multiple queues, that are dynamically created (during runtime). Also, there are multiple workers started that are free to work on any queues, because at start time there isn't any existing queues, and they cannot be predicted: $ COUNT=3 QUEUE=* rake resque:workers Queues a created based on the project 's id: @queue = "project_#{project.id}".to_sym For a given queue, their jobs have

Rails Resque change worker limit?

前提是你 提交于 2019-12-12 05:27:10
问题 I have Rails app with some Resque workers. It seems that I have a limit of 2 workers running simultaneously (app runs on EC2 with Apache in production). Is there any way I can raise that limit? EDIT: I have maxclients 0 in redis.conf I can start 10 workers through rake, but when they are actually getting queued, I get "ERR max number of clients reached" in browser.. EDIT: updated mistake (it was correct in original file) EDIT: actually had config/initializers/Resque.rb pointing to redis-to-go

How to setup Rails 4, Resque 2 to run with Foreman?

余生颓废 提交于 2019-12-12 04:18:19
问题 I am trying to run a simple Rails application on Heroku with some background tasks. The application is deployed to Heroku, so I run it with Foreman locally so that things are similar to how it would work in production. However, I cannot get Resque to start and stay up. It shuts down everytime, even without any tasks submitted. This is how things are setup. Gemfile (based on the github page for resque) gem "resque", "~> 2.0.0.pre.1", github: "resque/resque" Procfile web: bundle exec rails

Need help configuring a Redis-backed library on Ruby on Rails with RVM

余生颓废 提交于 2019-12-12 02:24:16
问题 I'm following the configuration guidelines for installing resque. I'm met with a (LoadError). I'm using RVM 1.9.2-p180, rails 3.0.6, and POW. This is probably an issue with my load path being totally wrong. So here is some extra info: master ~/projects/chaggregator $ which rails /Users/boris/.rvm/gems/ruby-1.9.2-p180/bin/rails master ~/projects/chaggregator $ which ruby /Users/boris/.rvm/rubies/ruby-1.9.2-p180/bin/ruby master ~/projects/chaggregator $ whereis ruby /usr/bin/ruby master ~

unable to call illuminate class from resque worker

丶灬走出姿态 提交于 2019-12-11 17:45:01
问题 I have just started using resque in my application, I have created a worker and can queue jobs up. I am having issues though using illuminate classes in my worker. below is the error i am seeing in the worker. PHP Fatal error: Class 'Redis' not found in path/to/worker Here is my worker class: class SvrRestart { public function setUp() { // ... Set up environment for this job } public function perform() { $instance = $this->args['instance']; Redis::del('restart:' . $instance); } public

How do you schedule Resque jobs on Heroku?

 ̄綄美尐妖づ 提交于 2019-12-11 16:34:09
问题 The rescue-scheduler gem installation says to create a separate Rake task for scheduling: https://github.com/resque/resque-scheduler#rake-integration namespace :resque do task :setup_schedule => :setup do ... task :scheduler => :setup_schedule $ rake resque:scheduler However my Heroku Procfile already has a worker process to run Resque: resque: env TERM_CHILD=1 RESQUE_TERM_TIMEOUT=7 QUEUE=* bundle exec rake resque:work COUNT=1 I don't want to create yet another worker process just to run