delayed-job

How to monitor delayed_job with monit

China☆狼群 提交于 2019-11-27 09:59:50
Are there any examples on the web of how to monitor delayed_job with Monit ? Everything I can find uses God , but I refuse to use God since long running processes in Ruby generally suck. (The most current post in the God mailing list? God Memory Usage Grows Steadily .) Update: delayed_job now comes with a sample monit config based on this question. Luke Francl Here is how I got this working. Use the collectiveidea fork of delayed_job besides being actively maintained, this version has a nice script/delayed_job daemon you can use with monit. Railscasts has a good episode about this version of

polling with delayed_job

无人久伴 提交于 2019-11-27 09:21:45
问题 I have a process which takes generally a few seconds to complete so I'm trying to use delayed_job to handle it asynchronously. The job itself works fine, my question is how to go about polling the job to find out if it's done. I can get an id from delayed_job by simply assigning it to a variable: job = Available.delay.dosomething(:var => 1234) +------+----------+----------+------------+------------+-------------+-----------+-----------+-----------+------------+-------------+ | id | priority |

Long running delayed_job jobs stay locked after a restart on Heroku

雨燕双飞 提交于 2019-11-27 07:08:27
When a Heroku worker is restarted (either on command or as the result of a deploy), Heroku sends SIGTERM to the worker process. In the case of delayed_job , the SIGTERM signal is caught and then the worker stops executing after the current job (if any) has stopped. If the worker takes to long to finish, then Heroku will send SIGKILL . In the case of delayed_job , this leaves a locked job in the database that won't get picked up by another worker. I'd like to ensure that jobs eventually finish (unless there's an error). Given that, what's the best way to approach this? I see two options. But I

How to cancel scheduled job with delayed_job in Rails?

邮差的信 提交于 2019-11-27 00:14:17
问题 I am scheduling a job to run in say, 10 minutes. How to properly cancel this particular job without using any kind of dirty extra fields in model and so on. Is there any call to remove particular job, or jobs related to specific model, instance, etc? 回答1: disclaimer: I am not an expert user of delayed_job... " Is there any call to remove particular job, or jobs related to specific model, instance, etc? " Delayed::Job is just an ActiveRecord object so you can find and destroy any of those

How to deploy resque workers in production?

霸气de小男生 提交于 2019-11-26 23:53:12
问题 The GitHub guys recently released their background processing app which uses Redis: http://github.com/defunkt/resque http://github.com/blog/542-introducing-resque I have it working locally, but I'm struggling to get it working in production. Has anyone got a: Capistrano recipe to deploy workers (control number of workers, restarting them, etc) Deployed workers to separate machine(s) from where the main app is running, what settings were needed here? gotten redis to survive a reboot on the

Getting delayed job to log

杀马特。学长 韩版系。学妹 提交于 2019-11-26 19:44:32
问题 #Here is how I have delayed job set up. Delayed::Worker.backend = :active_record #Delayed::Worker.logger = Rails.logger Delayed::Worker.logger = ActiveSupport::BufferedLogger.new("log/ ##{Rails.env}_delayed_jobs.log", Rails.logger.level) Delayed::Worker.logger.auto_flushing = 1 class Delayed::Job def logger Delayed::Worker.logger end end if JobsCommon::check_job_exists("PeriodicJob").blank? Delayed::Job.enqueue PeriodicJob.new(), 0, 30.seconds.from_now end #end #Here is my simple job. class

Node.js workers/background processes

送分小仙女□ 提交于 2019-11-26 18:55:43
问题 How can I create and use background jobs in node.js? I've come across two libs (node-resque and node-worker) but would like to know if there's something more used. 回答1: I did some research on this and I would do it like this. Setup beanstalkd Install beanstalkd. Another message queue, BUT this one supports DELAYED PUTS. If you compile from source it is going to be a little harder because it depends on libevent(like memcached). But then again, I don't think you have to compile it from source,

getaddrinfo: nodename nor servname provided, or not known

放肆的年华 提交于 2019-11-26 17:59:52
问题 I have a Ruby on Rails application that I am deploying on a computer running Mac OS X 10.6. The code where the problem arises is run by a delayed_job. The problem only occurs when it is run through delayed_job. If I run it within a console ( rails console production ) or call the API directly through cURL, it works without any problems. Also, the entire process works without issue in my development environment. Basically, the code works in one place, but for some reason, fails where it has to

How to monitor delayed_job with monit

跟風遠走 提交于 2019-11-26 14:58:53
问题 Are there any examples on the web of how to monitor delayed_job with Monit? Everything I can find uses God, but I refuse to use God since long running processes in Ruby generally suck. (The most current post in the God mailing list? God Memory Usage Grows Steadily.) Update: delayed_job now comes with a sample monit config based on this question. 回答1: Here is how I got this working. Use the collectiveidea fork of delayed_job besides being actively maintained, this version has a nice script