Questions tagged [delayed-job]

A Ruby library to queue and defer processing of slow methods like sending email and image resizing.

Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background.

It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks. Amongst those tasks are: •sending massive newsletters •image resizing •http downloads •updating smart collections •updating solr, our search server, after product changes •batch imports •spam checks

1613 questions
0
votes
1 answer

Writing a DelayedJob custom job to run script and then destroy object

I've been trying to figure this out for a long time, and can't figure it out. I am using DelayedJob in my Rails app in order to run a script to fill out some forms on a website via a Mechanize script. However, after the job completes, I don't want…
CodeBiker
  • 2,985
  • 2
  • 33
  • 36
0
votes
0 answers

Rails delayed_jobs don't run in a Rails context

So I have some delayed_jobs that are getting enqueued and dequeued properly. The problem is that when running them, either with $ bundle exec rake jobs:work or $ script/delayed_job start, the processing code doesn't properly load a Rails context,…
cbmanica
  • 3,502
  • 7
  • 36
  • 54
0
votes
2 answers

Can background jobs complete if you exit a browser after submitting a request?

I'm new to using background jobs (and much of programming in general) - so I'm aware this must be an simple question, but I haven't found an answer in my research. I've written a Ruby on Rails web app that I have deployed to Heroku. After a form is…
CodeBiker
  • 2,985
  • 2
  • 33
  • 36
0
votes
1 answer

Ruby on Rails - Delayed Job - Return job id

I got a Rails app which basically crawls a lot of RSS feeds. Each feed has a crawl interval like for example 3 hours. The problem is, since it's crawling more and more feeds every day(more and more get added) sometimes the 3 hours are over before…
Evo_x
  • 2,997
  • 5
  • 24
  • 40
0
votes
2 answers

Delayed Jobs: can't run rake jobs:work

Database:PostgreSQL 9.2 Delayed_job (3.0.5) Delayed_job_active_record (0.4.4) When I try to run rake task, rake aborted with: "invalid byte sequence in UTF-8 (argument error)" I have no idea what does it mean. As it probably really hard to…
Joe Half Face
  • 2,303
  • 1
  • 17
  • 45
0
votes
1 answer

Delayed Job object not properly deserialized

I'm having a hard time believing what I'm seeing, but it sure looks like DJ is failing to deserialize an object properly. I look at the DJ record in mongo and I see in the YAML that the object has its text field set, but when the code runs, the…
Leopd
  • 41,333
  • 31
  • 129
  • 167
0
votes
1 answer

Rails delayed_job argument error with mailer

I'm getting a "wrong number of arguments (2 for 1)" error when I try send a mailer to delayed_job. Everything works perfect if I don't try to push it to the background. Below is my controller with delayed_job: def export @user = User.where("id =…
KevinM
  • 1,799
  • 4
  • 28
  • 58
0
votes
2 answers

Bulk User Creation in Rails - good use of delayed_job?

In the administration panel for my rails application I want to give the administrator the ability to create several users at one time (in the hundreds range). Would this be a good use for delayed_job?
jluebbert
  • 260
  • 4
  • 12
0
votes
0 answers

Rails method works in console but not through browser

Here's what I do in my model: :after_save after_save def after_save self.delay.do_thing end def do_thing Dir.mkdir("#{Rails.root}/my/path") system("cd #{Rails.root}/my/path && wget -with-some-flags") end This works flawlessly in…
Alfo
  • 4,801
  • 9
  • 38
  • 51
0
votes
1 answer

"Proxy" Capture of $stderr and $stdout for DB Storage

I am trying to store the stderr and stdout in our database for the future debugging purpose of our background processes. I want also the capture to be transparent like a proxy, by that I mean that I want to still have the stderr and the stdout…
Hartator
  • 5,029
  • 4
  • 43
  • 73
0
votes
1 answer

Delayed_Job NoMethodError when using Nginx

I'm having trouble implementing the Delayed_Job_Active_Record gem in my Production Environment with Nginx. The user submits a 'Contact Us' form, the relevant controller action is called by Nginx and the following line of code…
mobydick
  • 151
  • 1
  • 8
0
votes
0 answers

Best way to handle a lot of different background tasks in Rails

We have to run in the background a lot of different tasks, including: Video Transcoding Video Uploads to S3 Create Objects in third-party APIs Grab Statistics from third-party APIs (every midnight) [....] I was forecasting to do everything myself.…
Hartator
  • 5,029
  • 4
  • 43
  • 73
0
votes
1 answer

Catching errors with Ruby Twitter gem, caching methods using delayed_job: What am I doing wrong?

What I'm doing I'm using the twitter gem (a Ruby wrapper for the Twitter API) in my app, which is run on Heroku. I use Heroku's Scheduler to periodically run caching tasks that use the twitter gem to, for example, update the list of retweets for a…
JoshDoody
  • 417
  • 1
  • 4
  • 14
0
votes
2 answers

How can I set a session variable from inside a monkeypath on String

I'm getting the following error... pry("serp")> session[self.to_sym] = "closed" NameError: undefined local variable or method `session' for "serp":String ...when I try to set a session variable from within a monkeypatch on the String class.…
steven_noble
  • 4,133
  • 10
  • 44
  • 77
0
votes
1 answer

Delayed_job going into a busy loop when lodging second task

I am running delayed_job for a few background services, all of which, until recently, run in isolation e.g. send an email, write a report etc. I now have a need for one delayed_job, as its last step, to lodge another delayed_job. delay.deploy() -…
Leif
  • 1,129
  • 1
  • 12
  • 18
1 2 3
99
100