delayed-job

Terminal says delayed_job starting, but not doing anything

女生的网名这么多〃 提交于 2019-12-22 17:29:15
问题 I have an app that works perfectly on my local machine and am deploying it now. I have the VPS all set up and it pretty much works, as well. My problem comes from not being able to start delayed_job. I do the "ruby script/delayed_job start RAILS_ENV=production" while SSHd to the app and it returns "delayed_job: process with pid 11547 started." When I look for the process in htop, I can't find it. So I dug around and read that Monit can keep delayed_job going. I set that up, hoping I could

Delayed_job Won't Run User defined method

折月煮酒 提交于 2019-12-22 16:41:04
问题 I have been trying to get DelayedJob to run some user defined methods in the background. For this test case I defined the following method in a helper: def test_case u = User.new u.first_name = "JimBob" u.last_name = "joe" u.email = "itworked@eureka.com" u.password = "sailsJ123" u.password_confirmation = "sailsJ123" u.save end Then, in a controller action, I define: def action_name #whatever it does outside of this test_case end This causes test_case to create a new user when the action here

delayed_job: how to force processing of failed jobs

落爺英雄遲暮 提交于 2019-12-22 10:53:33
问题 I am maintaining a rails app, on which i'm running the delayed_job gem for sending emails. I just noticed that all my delayed jobs've been failing the last few days due to a bug in the application. Now the bug is fixed and I want to process the jobs asap, but they are with already too many failed attempts, and the worker pulls them from the database with a huge delay. I've tried by updating the delayed_jobs table and set the number of attempts to a smaller number and the run_at attribute to

Delayed job and Mandrill: uninitialized constant Mandrill::API

☆樱花仙子☆ 提交于 2019-12-22 10:34:22
问题 I have mailer service where users can upload an .xls file with emails and some other user related data to send an email campaign. I was having some timeout issues since it takes some seconds to process (as I do some validation and configuration for each email to be sent, eg: save records to database, check if an email was sent in the last 30 days, create personalised html code for each email (to create links that contain the email address as a parameter, etc). After some research, moving this

Delayed::Job with modules

我的梦境 提交于 2019-12-22 00:05:35
问题 Does Delayed::Job work with modules? I have trouble with it: module SomeModule class SomeClass def regular_method self.delay.long_method "test" end def long_method data puts data end end end Error message: [Worker(host:leo pid:10480)] SomeModule::SomeClass#long_method failed with NoMethodError: undefined method `long_method' for #<YAML::Object:0xcee13b0 @class="SomeModule::SomeClass", @ivars={}> - 4 failed attempts [Worker(host:leo pid:10480)] 1 jobs processed at 9.1484 j/s, 1 failed ... 回答1:

How to solve the “You need to add gem 'daemons' to your Gemfile if you wish to use it” error in production mode?

我怕爱的太早我们不能终老 提交于 2019-12-21 17:36:20
问题 I am trying to properly use Capistrano and RVM in order to deploy my Ruby on Rails 3.2.2 application to the remote machine that is running Ubuntu 10.04 LTS. It seams that I solved my previous problem related to the "Rvm - Capistrano integration on Linux Ubuntu". However, on deploying I get the following error related to the DelayedJob gem: ... * executing "cd /srv/www/<APP_NAME>/releases/20120314135318 && bundle install" servers: ["<DOMAIN>"] [<DOMAIN>] executing command [<DOMAIN>] rvm_path=

Best practice for processing a lot of data while the user waits (in Rails)?

╄→гoц情女王★ 提交于 2019-12-21 17:19:38
问题 I have a bookmarklet that, when used, submits all of the URLs on the current browser page to a Rails 3 app for processing. Behind the scenes I'm using Typhoeus to check that each URL returns a 2XX status code. Currently I initiate this process via an AJAX request to the Rails server and simply wait while it processes and returns the results. For a small set, this is very quick, but when the number of URLs is quite large, the user can be waiting for up to, say, 10-15 seconds. I've considered

Starting multiple DelayedJob workers w/ specific queues via Capistrano tasks

梦想的初衷 提交于 2019-12-21 07:56:24
问题 I'm looking into using queues with delayed_job. I've found this page which outlines various ways of starting workers, however I'd like to keep my currently Capistrano method: set :delayed_job_args, "-n 2 -p ecv2.production" after "deploy:start", "delayed_job:start" ... I was wondering how I could modify the delayed_job_args to handle spawning 1 worker with a specific queue, and 1 worker for every other job. So far, all I have is overriding each task like so: namespace :delayed_job do task

Can a Heroku app add/remove dynos or workers to/from itself?

*爱你&永不变心* 提交于 2019-12-21 06:36:41
问题 Heroku allows you to add and remove dynos and workers on the fly and charges you per second that each is used. Is it possible to set up my app so that it can add/remove dynos and workers from itself depending on the load it's under? This paragraph on Heroku.com mentions an API, but I can't find out much more about it. 回答1: Yes. What you want is something like this: require 'heroku' Heroku::Client.new("username", "password").set_workers("appname", num_workers) 来源: https://stackoverflow.com

Rails: Can I run backgrounds jobs in a different server?

谁说我不能喝 提交于 2019-12-21 05:21:08
问题 Is it possible to host the application in one server and queue jobs in another server? Possible examples: Two different EC2 instances, one with the main server and the second with the queueing service. Host the app in Heroku and use an EC2 instance with the queueing service Is that possible? Thanks 回答1: Yes, definitely. We have delayed_job set up that way where I work. There are a couple of requirements for it to work: The servers have to have synced clocks. This is usually not a problem as