resque

Multiple resque workers mode creating extra processes

孤人 提交于 2019-12-03 07:55:01
I need to start 4 resque workers so i used following command bundle exec rake environment resque:workers RAILS_ENV=production COUNT=4 QUEUE=* VERBOSE=1 PIDFILE=tmp/pids/resque_worker.pid >> log/resque_worker_QUEUE.log But going to web interface, it was actually starting 8 workers. There were two parent processes with 4 child processes each. Following is tree view of the processess: ruby /code_base/bundle/ruby/1.9.1/bin/rake environment resque:workers RAILS_ENV=production COUNT=4 QUEUE=* VERBOSE=1 PIDFILE=tmp/pids/resque_worker.pid \_ [ruby] \_ resque-1.15.0: Waiting for * | \_ [ruby] \_ resque

Have Rails 2.3.x ignore the i18n gem

こ雲淡風輕ζ 提交于 2019-12-03 07:19:38
I have a Rails 2.3.5 project that uses the localization features of Rails. I also happen to have Rails 3 beta installed (which depends on the i18n gem). Rails 2.3.5 will happily handle localization on it's own (without i18n installed), however if the i18n gem is available, it makes use of it. Recently I upgraded my gems and now have version 0.3.7 and 0.4.0 of i18n installed. Rails, of course, wants to load and use the latest version which is causing errors in my project. I tried setting the gem version to 0.3.7 which gets around the errors in the web app. However, we're using resque and resque

Jobs processing in background from web application

∥☆過路亽.° 提交于 2019-12-03 06:57:40
I want to schedule and run a lot of jobs in the background during a web application execution. The web app is built on top of Symfony 2 and Doctrine 2. I know the job-processing can be done with libraries like Resque or Sidekiq. However, these libraries and my application are written in different languages, so I am wondering how I can run Sidekiq jobs written in Ruby which should integrate with my app written in PHP. What I'm asking myself is if the only way to do this is rewriting a large amount of code to query the database from PHP to ruby, to be able to execute the job in Sidekiq/Resque.

How to bridge the testing using Resque with Rspec examples?

家住魔仙堡 提交于 2019-12-03 05:41:56
问题 I've a confusion while implementing Resque in parallel with Rspec examples. The following is a class with expensive method .generate(self) class SomeClass ... ChangeGenerator.generate(self) ... end After implementing resque, the above class changed to the following and added a ChangeRecorderJob class. class SomeClass ... Resque.enqueue(ChangeRecorderJob, self.id) ... end class ChangeRecorderJob @queue = :change_recorder_job def self.perform(noti_id) notification = Notification.find(noti_id)

How to stop God from leaving stale Resque worker processes?

痴心易碎 提交于 2019-12-03 02:14:30
I'm trying to understand how to monitor the resque worker for travis-ci with god in such a way that stopping the resque watch via god won't leave a stale worker process. In the following I'm talking about the worker process, not forked job child processes (i.e. the queue is empty all the time). When I manually start the resque worker like this: $ QUEUE=builds rake resque:work I'll get a single process: $ ps x | grep resque 7041 s001 S+ 0:05.04 resque-1.13.0: Waiting for builds And this process will go away as soon as I stop the worker task. But when I start the same thing with god ( exact

How to destroy jobs enqueued by resque workers?

回眸只為那壹抹淺笑 提交于 2019-12-03 01:20:07
问题 I'm using Resque on a rails-3 project to handle jobs that are scheduled to run every 5 minutes. I recently did something that snowballed the creation of these jobs and the stack has hit over 1000 jobs. I fixed the issue that caused that many jobs to be queued and now the problem I have is that the jobs created by the bug are still there and therefore It becomes difficult to test something since a job is added to a queue with 1000+ jobs. I can't seem to stop these jobs. I have tried removing

How to use ActionController::Live along with Resque + Redis (for Chat application)

送分小仙女□ 提交于 2019-12-03 00:24:26
I am trying to build a chat feature for my rails application. I am using ActionController::Live , Puma , Resque , Redis for this. So basically in this case, redis subscribe method is running in background using resque . So far what i have done is whenever a user enters a text in below form field i.e. chat box <%= form_tag chat_box_publish_path, method: :get do %> <%= text_field_tag :query, params[:query], class: "form-control", id: "chatSearchBox", placeholder: 'Search' %> <% end %> ..the request is coming to Publish method in ChatBoxController . def publish $redis.publish("chat_message:1:1",

Are spies an appropriate approach to see if Resque methods are being fired?

风流意气都作罢 提交于 2019-12-02 23:49:04
问题 While simple coverage is reporting this as 100% covered I am not satisfied. The spec marked as focus I would like to confirm that all of the Resque methods are being fired. Is a spy or a double the right approach for this? Spec describe 'resque tasks' do include_context 'rake' let(:task_paths) { ['tasks/resque'] } before do invoke_task.reenable end # rubocop:disable all describe 'resque' do context ':setup' do let(:task_name) { 'resque:setup' } it 'works' do invoke_task.invoke expect(Resque

How to bridge the testing using Resque with Rspec examples?

坚强是说给别人听的谎言 提交于 2019-12-02 20:20:05
I've a confusion while implementing Resque in parallel with Rspec examples. The following is a class with expensive method .generate(self) class SomeClass ... ChangeGenerator.generate(self) ... end After implementing resque, the above class changed to the following and added a ChangeRecorderJob class. class SomeClass ... Resque.enqueue(ChangeRecorderJob, self.id) ... end class ChangeRecorderJob @queue = :change_recorder_job def self.perform(noti_id) notification = Notification.find(noti_id) ChangeGenerator.generate(notification) end end It works perfectly. But I have 2 concerns. Before, my

Resque multiple workers in development mode

北慕城南 提交于 2019-12-02 18:23:30
Hi is it possible to run multiple Resque workers simultaneously in development? I found this bit of code, but not sure if it will work and how.. http://pastebin.com/9GKk8GwR So far I am using the standard bundle exec env rake resque:work QUEUE='*' redis-server /usr/local/etc/redis.conf You need to add a COUNT environment variable and then change resque:work to resque:workers . For example, to start 3 workers: bundle exec env rake resque:workers QUEUE='*' COUNT='3' The only way I know how to do that, and I think it's a great way, it's using Foreman (same thing that heroku uses). You define your