delayed-job

Rails Delayed Job & Library Class

Hey we have a library class (lib/Mixpanel) that calls delayed job as follows: class Mixpanel attr_accessor :options attr_accessor :event def track!() .. dj = send_later :access_api # also tried with self.send_later .. end def access_api .. end The problem is that when we run rake jobs:work: we get the follo...

HELP!! Delayed-job: Rake aborted! Can't modify frozen hash

Too bad even the trace doesn't say which hash is involved. Sorry this post is long: am trying to provide enough context to be meaningful. Occurs intermittently when rake jobs:work is pulling a command out of delayed_jobs while my status observer is in the process of parsing a log file for detailed results of the previous delayed_job de...

Delayed_Job - on site5 server

I am currently using a site5 server and would like rake jobs:work pretty much running all the time. I currently cannot send out the jobs unless i'm logged into the server. I hope that someone out there can help me with this. Had alot of trouble with ar_mailer and the whenever gem ... but have about another 5 gems working perfectly withi...

Start or ensure that Delayed Job runs when an application/server restarts.

Hi there, We have to use delayed_job (or some other background-job processor) to run jobs in the background, but we're not allowed to change the boot scripts/boot-levels on the server. This means that the daemon is not guaranteed to remain available if the provider restarts the server (since the daemon would have been started by a capis...

Are there any Rails Plugins that use JS to poll the server for completion of a background process?

I know it might be simple to write some polling JS that asks the Rails application if it has completed a background job. But I wonder if anyone has already packaged up this functionality as a plugin. Basically, I have a few delayed_jobs running, and am looking for a plugin that will poll the server for completion of a particular job, th...

rake task via cron problem loading rubygems

I have managed to get a cron job to run a rake task by doing the following: cd /home/myusername/approotlocation/ && /usr/bin/rake sendnewsletter RAILS_ENV=development i have checked with which ruby and which rake to make sure the paths are correct (from bash) the job looks like it wants to run as i get the following email from the cr...

Help installing delayed_job

I'm trying to use collectiveidea's delayed_job gem The installation instructions include Rake tasks are not automatically loaded from gems, so you’ll need to add the following to your Rakefile: begin require 'delayed/tasks' rescue LoadError STDERR.puts "Run `rake gems:install` to install delayed_job" end Where is my Rakefile? And...

Generating PDF's via Delayed Job while maintaing a RESTful pattern.

Hi, currently I am running a Rails app on Heroku, and everything is working great with exception of generating PDF documents that sometimes contain thousands of records. Heroku has a built-in timeout of 30 seconds, so if the request takes more than 30 seconds, it's abandoned. That's fine, since they offer delayed_job support built-in. ...

Delayed_job: undefined method `handle_asynchronously' for #<Class:0x4601b08>

After deploying DelayedJob as a gem, I got the following error: undefined method `handle_asynchronously' for #<Class:0x4601b08> Same code works when I deploy DelayedJob as a plugin. I have tried the solution suggested by this SO question and I still get the same error. I am using DelayedJob 1.8.4, Windows XP, Rails 2.3.5. ...

Rails running multiple delayed_job - lock tables

Hey. I use delayed_job for background processing. I have 8 CPU server, MySQL and I start 7 delayed_job processes RAILS_ENV=production script/delayed_job -n 7 start Q1: I'm wondering is it possible that 2 or more delayed_job processes start processing the same process (the same record-row in the database delayed_jobs). I checked the c...

Rails delayed_job sending email as HTML

Using delayed_job to send emails- files are filename.text.html.erb Sometimes they show up in my inbox rendered properly and sometimes they show up as HTML code. I notice that when I stop and start the delayed_job daemon on the server, it seems to help in some cases but not all the time. Any ideas? ...

Guide to migrate from delayed_job to resque?

Does anyone have or know of a guide for how to migrate from Delayed Job to Resque? I can't find any on Google and figure I must not be the first one doing this. Just a general list of changes that need to made and things to watch out for would be great. ...

Delayed Jobs is not finding Records and failing..

In my app, delayed jobs isn't running automatically on my server anymore. It used to.. When I manually ssh in, and perform rake jobs:work I return this : *** Starting job worker host:ip-(censored) pid:21458 * [Worker(host:ip-(censored) pid:21458)] acquired lock on PhotoJob * [JOB] host:ip-(censored) pid:21458 failed with ActiveRecord:...

How do you do exception management with delayed job?

My application needs to parse a user-generated CSV file. And, once uploaded, the application will queue it in delayed job to be processed. My question is, how do you usually handle the exceptions that might happen during the content parsing stage? Do you store all the error messages in exception-objects before display it to user? Thank ...

Use Delayed::Job to manage multiple job queues

I want to use Delayed::Job (or perhaps a more appropriate job queue to my problem) to dispatch jobs to multiple background daemons. I have several background daemons that carry out different responsibilities. Each one is interested in different jobs in the queue from the Rails app. Is this possible using Delayed::Job, or perhaps there i...

rails wiki site - article edit highlighting/strikethrough with htmldiff maxes cpu

Hi I'm implementing a wiki style site and want to highlight changes made to articles between successive versions. Using htmldiff to highlight changes works great, except it is rather cpu intensive. I'm using the awesome vestal_versions plugin for versioning. So how best to handle this? I considered having an on_create callback on versi...

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

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. ...

An affordable way to use multiple Delayed::Job queues

I have a Ruby on Rails app that needs process many background jobs simultaneously: anywhere from 5-6 at a time to up to 50-60 at a time depending on the time of day. Right now my app is running on Heroku, which charges $.05/hour per worker, regardless of how much CPU or memory the worker is using. This is costing me a boatload each month...

upload csv file with delayed job.

I have a rake task loaddata.rake. require File.join(File.dirname(__FILE__), 'load_test_data.rb') namespace :test do desc "Insert test data into the database" task(:loadtest => :environment) do puts "environment = #{RAILS_ENV}" puts "load_test_data "; load_test_data puts "DONE!" end end I have another fi...

Problem with rake jobs:work.

while i am running rake jobs:work. I am getting this error. ** Invoke jobs:work (first_time) ** Invoke merb_env (first_time) ** Execute merb_env ** Invoke environment (first_time) ** Execute environment rake aborted! uninitialized constant Delayed C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443...