delayed-job

delayed_job - Performs not up to date code?

I'm using delayed_job (tried both tobi's and collective_idea's) on site5.com shared hosting, with passenger as rails environment. I managed to make jobs done. However, it seems the plugin ignores any changes in a job class source code after first run. I have restarted the server on every change (touch tmp/restart.txt) but it still ignore...

Kill all delayed_job workers

I use delayed_job as a daemon http://wiki.github.com/tobi/delayed%5Fjob/running-delayedworker-as-a-daemon. I can't tell why, but sometimes I see more than one job done by several workers (different pids), and running stop doesn't stop anything. is there a way to kill all daemons of this proc/all workers? Or kill a specific pid (I'm on a...

Fork delayed job from the app server?

Here's my simple ideal case scenario for when I'd like delayed job to run: When the first application server (whether through mongrel or passenger) starts, it'll start my delayed job workers. When the last running application server terminates, it'll kill all the delayed job workers. The first part (starting) is doable, although I'm ...

Can delayed_jobs create delayed_jobs?

I'm trying to figure out if I'm able to use delayed_job. I would need the ability to add jobs to the queue within a delayed_job perform method. Is this possible? ...

Delayed::Job, Monit and Memory Error

So I've had Delayed::Job running swimmingly in production for a while. Whenever i'd make a change to a job I would (all in the production env mind you) restart delayed job using the [script](http://wiki.github.com/tobi/delayed_job/running-delayedworker-as-a-daemon) i used clear the jobs using `rake jobs:clear` Also, i have monit runn...

Delayed Job Rake Task Failing

I'm trying to get delayed job to work as a rake task, but for the life of me I can't figure out what I'm doing wrong. Given the following setup: #config/environment.rb Rails::Initializer.run do |config| config.gem 'delayed_job' end #Rakefile begin require 'delayed/tasks' rescue LoadError STDERR.puts "Run `rake gems:install` ...

How to implement SQL Server Job that waits to another job finish?

Hi, I'm looking a way to implement a precedence step on SQL Server Agent that will verify is a specific job is running. If so, the step will entry in a "wait" state until first job finish with success. To clarify, this will be the cenario: Job Name: 'My Job' Job to be checked: 'Validate tables' Steps of 'My job': Step 1: Check if '...

How to show an animated spinner while a background task is processing in nested rails model using ajax

My specific example is highly complex, so I will use the example shown by Ryan from Railscasts to discuss this: http://railscasts.com/episodes/197-nested-model-form-part-2 Background I have a form, let's say "Survey", which contains an arbitrary number of "Questions". Senario Give i am on the "Edit Survey" page. I would like to add...

log doesn't work in production with delayed job

I'm suffering some weird issue where my delayed_jobs are failing in production. Finally I narrowed it down to the logger. If I comment out my log function calls, everything works. However if I try to log, I get this in the delayed_job handler: --- !ruby/struct:Delayed::PerformableMethod object: AR:User:1 method: :load_and_update_wi...

Delayed_job running same job multiple times?

I've been using delayed_job without issues for a while now; mostly for queuing ActionMailer calls (Notifier.send_later ...). Lately it sends out random multiples of emails from the same job. I'll queue one email and I'll receive it five times, or once, or twice, all at the same time. I've restarted delayed_job and it seems to behave for ...

Running Jobs when DB is free on Ruby on Rails Heroku

I have a ruby on rails app that uses Heroku. I have the need to run things like import/export tasks on our db that lock up the whole system since they are so heavy on the DB. Is there a way to tell the system to only run these tasks when the database is not being used at that second? ...

Running tasks in the background with lower CPU priority

I have a feature in my CMS that allows a user to upload a zip file full of images and the server will extract them and insert each one into an image gallery. I've noticed that this grinds up the CPU quite severely and causes other requests to slow down. I'm thinking of using the delayed_job plugin to delegate each image addition into th...

Log format with delayed_job

I am writing to log/delayed_job.log from within a perform method: class MyWorker def perform logger.error("testing logger") end end In log/delayed_job.log my error message is printed but without any formatting (prefixed with the date/time) compared to the other messages logged by delayed_job: 2010-03-10T14:46:18-0400:...

In a rails app, should e-mail be sent as a background job or synchronously?

We are getting close to releasing our new rails app and so far interest seems very strong we are a little worried about where bottle necks will be. One seems to be system e-mails on signup and in other situations. Is this correct? Should individual e-mails to users be sent asynchronously in the background? If so, what would be the be...

Any way to have delayed_job execute some run-once code at startup and use across all jobs?

So I've got a delayed_job task that pushes some info to an XMPP server. Ideally you create a connection to XMPP once and then constantly push data to it, rather than creating a new connection every time you have some data to send. Is there any kind of facility in delayed_job for running a sort of 'setup' method when a worker starts, hav...

How to implement temporarily undoable operations in PHP and JavaScript?

I would like to implement operations that is undoable in a short time after the user have done them. I.e. if a user upvotes a photo in a photo-site, he/she can undo the vote within 30 seconds. This is similar to how the voting on StackOverflow is working, you can undo your votes for a short time. How should I implement it? I guess that ...

Background job with status in rails

Hey. I would like to upload a file and then parse it. Because parsing can take up to 10min I installed delayed_job plugin and called parsing function through send_later function. I have to mention that this is an AJAX app. Imagine that you press an AJAX button that starts upload and after that the source is imported into the database. D...

Using delayed_job to process file uploads across multiple servers

Does anyone have any good resources on how to do this? Basically, I'm working on a project (in Rails) where people can upload files. They might be big. I'd like to process them using delayed_job before sending them to S3. I'd also like to do this processing on a separate job queue server, rather than on the webserver itself. I'd rather ...

Delayed_job ID - rails

Example: obj = MyModel.send_later :modelMethod How can I get an ID of the delayed_job inside :modelMethod function? Thx! ...

Monitor database table for external changes from within Rails application

I'm integrating some non-rails-model tables in my Rails application. Everything works out very nicely, the way I set up the model is: class Change < ActiveRecord::Base establish_connection(ActiveRecord::Base.configurations["otherdb_#{RAILS_ENV}"]) set_table_name "change" end This way I can use the Change model for all existing re...