delayed-job

how do i use delayed_job on heroku to send out emails that are batched?

Hi, I read the documentation on workers and delayed_job and couldn't follow exactly, so wanted to get head-start with some strategy and sample code. I have a controller which I use to send emails one by one. Now each day I want to check which emails need to be sent for the day, and then send them through heroku as a delayed_job. How ...

Heroku - DelayedJob & Autoscale

Hi I'm pretty much in wonder of the idea of autoscaling workers on Heroku with this delayed job branch. Only problem is I can't figure out why it won't work. What I've got thus far: I've installed the branch as a plugin. Added the two lines of configuration as described in the branch comments: Delayed::Job.destroy_failed_jobs = fals...

How to have users create scheduled tasks in rails app deployed on Heroku

I have a rails app deployed on Heroku. I want to add a feature that enables users of the app to set a reminder. I need some way for the app to schedule sending an email at the time specified by the user. I have found numerous posts referring to using delayed_job for this, but none of the write-ups / tutorials / etc. that I have found ...

On Rails, how to run a simple line using delayed_job?

For http://github.com/collectiveidea/delayed_job Let's say I just start a brand new Rails project and want the following to be run every 1 minute: puts "Time is now #{Time.now}" How would I add it to the project? The README says: class NewsletterJob < Struct.new(:text, :emails) def perform emails.each { |e| NewsletterMailer.d...

On Rails, using delayed_job, Kernel.delay.puts "hello" won't work?

Using http://github.com/collectiveidea/delayed_job It says: Call .delay.method(params) on any object and it will be processed in the background. Notifier.delay.deliver_signup @user If I start a brand new Rails project, and create a scaffold of story, and use either: class StoriesController < ApplicationController def index ...

Is Rails's "delayed_job" for cron task really?

delayed_job is at http://github.com/collectiveidea/delayed_job Can delayed_job have the ability to do cron task? Such as running a script every night at 1am. Or run a script every 1 hour. If not, what are the suitable gems that can do that? And can it be monitored remotely using a browser, and have logging of success and error? ...

How to cancel scheduled job with delayed_job in Rails?

Title says it all basicly. 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? ...

Heroku & Delayed Job - Autoscale Branch - RestClient::ResourceNotFound

SomeController#update (RestClient::ResourceNotFound) "Resource Not Found" I'm receiving this error (where previously I was not) while trying to enqueue delayed jobs using the autoscale branch of DelayedJob. This does not occur with a none autoscale branch but I'm at a loss to pinpoint what the problem is. If anyone is experiencing the...

Paperclip to upload images to S3 in Rails. The files upload at a very slow rate. A work-around?

I'm working on a rails app where the user will be uploading large quantities of images. My current setup: Using SWFUpload to upload multiple files at once using the Paperclip plugin with S3 storage. After the original image is uploaded to S3, Delayed_Job is used for the post processing (thumbnails, etc). The problem I have is that the...

Cannot enqueue items which do not respond to perform -- delayed_job on heroku

Hi, I am trying to use delayed_job on heroku and I get the following error: Cannot enqueue items which do not respond to perform I am using the plugin http://github.com/pedro/delayed_job I am using the following cron rake task (cron.rake): task :cron => :environment do require 'heroku' puts "starting the cron job at #{Date....

Getting PG Error hard to debug when using delayed_job on heroku

I am trying to use heroku and appear to be getting a Postgres error but don't have enough information to know what to fix. The error is below, and it looks like it is trying to run delayed_job: > PGError: ERROR: value too long for > type character varying(255) : UPDATE > "delayed_jobs" SET "updated_at" = > '2010-09-12 01:06:59.354515'...

How to send all email from a Rails app asynchronously

I have a rails app that uses delayed_job. Whilst DJ gives me a really easy way to setup delays on emails, is there any way to globally configure my app to send all email asynchronously regardless? The reason for this is that I have some gems that send email and don't want to have to modify them to accept DJ. ...

workling & RabbitMQ

Hi For my project I would like to run some jobs in background using workling (publish some data to the queue) but I'm getting errors while trying to configure my app (unitialized constant MemCache) I'm using Fedora 13 + ruby enterprise edition My questions are Has anybody worked with workling recently ? Was everything fine ? Did you ...

Syntax question for delayed_jobs and email

I am getting a beautiful error : failed with NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[] - 3 failed attempts My Controller: CardSignup.all.each do |user| Delayed::Job.enqueue MassEmail.new(user, params[:subject]...

How can i send emails with delayed_job

I'm trying to use delayed_job to send emails from an input form. In my view i have replaced the line Emailer.deliver_signup(@usercontact) with Emailer.send_later(:deliver_signup, @usercontact) but when i run the job with rake jobs:work, i get: undefined method 'deliver_signup' for "CLASS:Emailer":String What am I doing wrong? (N...

How do I debug this 'no method' error in ruby on rails?

I get the following error: Delayed::Job SomeMailJob# (NoMethodError) "undefined method `subject' for #<YAML::Object:0x2b0a191f4c78>" This comes from the following code which references the SombMailJob above: class SomeMailJob < Struct.new(:contact, :contact_email) def perform OutboundMailer.deliver_campaign_email(contact,co...

How do I save an object only after a delayed_job is successfully completed?

I have a delayed_job designed to send an email using a mailer. Upon completion, I need to record that the email was sent -- I do this by saving the newly created ContactEmail. Right now, the new ContactEmail records gets saved even if the delayed_job fails. How do I correct that so that the new ContactEmail is only saved when the mail...

Sending delayed email from devise

Is there a simple way of telling Devise to send all email via delayed_job? ...

How do I see what's going on with queued jobs using delayed_job?

I have been running delayed_job and was hitting some errors, but now I don't know what is sitting in the job queue or what's going on with them.... How can I figure that out so I can debug whether it is able to execute what has been put in the queue? Here is where I call the job (it is part of a cron task) and the mailer it calls: c...

How do I interpret this delayed_job error on heroku?

I am trying to run delayed_job on heroku and it doesn't appear to be working. So I went into the heroku console to check out what might be going on with the following: Delayed::Job.find(:last) This is what I came back with: => #<Delayed::Job id: 241, priority: 0, attempts: 22, handler: "--- !ruby/struct :SomeMailJob \ncontact: !ruby...