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
16
votes
3 answers

How to ignore Delayed Job query logging in development on Rails

How would I silence/ignore these Delayed Job query logs from log/development.log? Delayed::Backend::ActiveRecord::Job Load (1.0ms) UPDATE "delayed_jobs" SET locked_at = '2013-11-19 19:55:45.053991', locked_by = 'host:desktop-virtual pid:22277'…
Erik Nomitch
  • 1,575
  • 13
  • 22
16
votes
3 answers

Run Delayed Jobs and Sidekiq at the same time

I currently use delayed job to process jobs asynchronously. Instead of creating workers, I use the .delay method a lot. I want to move to Sidekiq, but I have too many types of jobs, and can't make sure all of them are thread safe. So I want to run…
lulalala
  • 17,572
  • 15
  • 110
  • 169
16
votes
4 answers

Running delayed_job worker on Heroku?

So right now I have an implementation of delayed_job that works perfectly on my local development environment. In order to start the worker on my machine, I just run rake jobs:work and it works perfectly. To get delayed_job to work on heroku, I've…
Danish M.
  • 997
  • 1
  • 10
  • 19
15
votes
2 answers

Dealing with very long running rake task

I am interested in running a very long running rake task, one that would take hours to complete and I am interested in learning about best practices for dealing with this problem. Possible solutions I have found: Set up a cron job delayed_job …
JZ.
  • 21,147
  • 32
  • 115
  • 192
15
votes
4 answers

How to automatically restart delayed_job when deploying a rails project on Amazon Elastic Beanstalk?

I'm hosting a rails project on Amazon Elastic Beanstalk and I try to configure a container command to automatically restart my delayed_job worker on the server after each deployment. I tried with this one : container_commands: restartdelayedjob: …
14
votes
3 answers

Delayed job: How to reload the payload classes during every call in Development mode

I am running a delayed job worker. When ever I invoke the foo method, worker prints hello. class User def foo puts "Hello" end handle_asynchronously :foo end If I make some changes to the foo method, I have to restart the worker for the…
Harish Shetty
  • 64,083
  • 21
  • 152
  • 198
14
votes
4 answers

Why do sites like stackoverflow with badges use some type of delayed job to determine when to award a new badge?

Stackoverflow has a nifty badge system. One thing I noticed is that badges are not immediately awarded, but sometimes seem to have some type of a delay after I meet the criteria. I've noticed this on some other sites that have badges as…
William Jones
  • 18,089
  • 17
  • 63
  • 98
14
votes
4 answers

Rails 4.2 get delayed job id from active job

Any idea how to get the Delayed::Job id from the ActiveJob enqueuing? When I enqueue a job I get back an instance of ActiveJob::Base with a @job_id, but that job id seems to be internal to ActiveJob. My best guess so far is just to walk down the…
kddeisz
  • 5,162
  • 3
  • 21
  • 44
14
votes
2 answers

Resque jobs, how to stop running job

My Resque worker class class WebWorker @queue = :jobs_queue def self.perform(id) //bunch of code here end end I remove from the queue a certain job like this Resque.dequeue(WebWorker,id) But I would like to stop running job and restart,…
Aydar Omurbekov
  • 2,047
  • 4
  • 27
  • 53
14
votes
2 answers

Best Ruby on Rails Architecture for Image Heavy App

I'm building an application that allows for large amounts of photo uploads at once, and wanted to know what the best setup would be to tackle this. This is what I am using so far: Jquery File Upload: allows users to drag and drop…
14
votes
4 answers

delayed_job update query is running infinitely

I am using delayed_job and delayed_job_active_record for back ground job execution in my rails application. We are using queue based delayed_job. For starting the delayed I am using the following command. RAILS_ENV=staging script/delayed_job -i=1…
apr
  • 676
  • 1
  • 9
  • 21
14
votes
3 answers

Node.js Kue how to restart failed jobs

I am using kue for delayed jobs in my node.js application. I have some problems to figure out how I can restart a job using the API of kue without having to move the id of a job manually from the the list of failed jobs to the list of inactive jobs…
Matthias
  • 647
  • 5
  • 13
13
votes
6 answers

Delayed jobs restarting + Capistrano best practices

I just wanted to understand best practices for restarting delayed jobs workers using capistrano. I've got a bunch of workers that process long jobs (up to 10minutes). I've come across two scenarios during a deploy while the workers are…
James
  • 2,284
  • 1
  • 20
  • 29
13
votes
3 answers

Rails 6 & deliver_later doesn't affect ActionMailer::Base.deliveries

After upgrading to Rails 6 I am noticing that default mailer's .deliver_later is not working the same as in Rails 5. Configuration: config.active_job.queue_adapter = :inline When running Mailer.register_email(...).deliver_later - nothing is…
knagode
  • 5,816
  • 5
  • 49
  • 65
13
votes
1 answer

Schedule at a specific time with delayed job

Is there a way to schedule a job at a specific time with delayed_job through the "delay" method, not through handle_asynchronously? Something like: class.delay.method(param), :run_at => Proc.new {time}
Ace Dimasuhid
  • 1,032
  • 11
  • 33