delayed-job

Error reporting when sending emails with delayed_job

流过昼夜 提交于 2020-01-12 14:26:23
问题 What's the proper way to get error reports, when using a tool like AirBrake or ExceptionNotifier from mailing delayed jobs? I tried to creating my own delayed job class, but the mail object created by Mailer.welcome() (or similar) is not serialized correctly. I also tried adding an error(job, exception) method to the PerformableMailer and PerformableMethod classes, but I got more errors generally related to serializing I believe. I tried both psych and sych for the serialization. 回答1: Updated

Gems/Services for autoscaling Heroku's dynos and workers

我的梦境 提交于 2020-01-09 12:51:16
问题 I want to know if there are any good solutions for autoscaling dynos AND workers on Heroku in a production environment (probably a different solution for each of those, as they are pretty unrelated). What are you/companies using, regarding this? I found lots of options, but none of them seem really mature for a production environment. There is Heroscale, which seem to introduce some latency as it does not run locally, and I also heard of some downtime. There are modifications of delayed_jobs,

delayed_job how to set .delay(run_at: from (attribute).time.from_now)

久未见 提交于 2020-01-07 07:49:35
问题 I am using delayed_job successfully like: Mailer.delay(run_at: 1.minutes.from_now).my_mail(my model) I would like to set the minutes with an attribute, in this case called :frequency . i have tried with :frequency/frequency:/(frequency)/[frequency][:frequency] one of the errors I'm getting is undefined method `minutes' for :frequency:Symbol Is what I'm trying to do possible? or should i do something else? How should i do it? Thanks for your help. 回答1: Try: frequency = 10 "#{frequency}".to_i

DelayedJob with acts_as_ferret in production mode

一笑奈何 提交于 2020-01-06 16:41:31
问题 I get the following error when I run my task via DelayedJob: closed stream /usr/lib/ruby/1.8/drb/drb.rb:961:in `select' /usr/lib/ruby/1.8/drb/drb.rb:961:in `alive?' /usr/lib/ruby/1.8/drb/drb.rb:1211:in `alive?' /usr/lib/ruby/1.8/drb/drb.rb:1168:in `open' /usr/lib/ruby/1.8/drb/drb.rb:1166:in `each' /usr/lib/ruby/1.8/drb/drb.rb:1166:in `open' /usr/lib/ruby/1.8/drb/drb.rb:1163:in `synchronize' /usr/lib/ruby/1.8/drb/drb.rb:1163:in `open' /usr/lib/ruby/1.8/drb/drb.rb:1092:in `method_missing' /usr

DelayedJob: “Job failed to load: uninitialized constant Syck::Syck”

梦想与她 提交于 2020-01-06 04:24:46
问题 I am using Ruby on Rails 3.1 and the DelayedJob gem. I have a Contact Us form through which people can contact me. When I submit that I get the following error `last_error` = '{Job failed to load: uninitialized constant Syck::Syck. Handler: \"--- !ruby/struct:Delayed::PerformableMailer ... However, I have also others forms that send e-mails (eg: Sign Up and Sign In users) and those work as expected. The only problem seems to occur with the Contact Us form. I read others related problem posts

Is this expected behaviour for Delayed Job, Rails and Mandrill?

旧时模样 提交于 2020-01-06 02:18:08
问题 Related to this question, which explains the origins of the logic in the controller, I have a question about background jobs with Delayed Job before pushing it to github and re-deploying. The model and scopes work, the logic in the controller(s) works, the conditionals in the e-mail text.erb files work, users are either readers or subscribers and can set their e-mail preferences on their "My Account" page: [Articles & Updates, Just Articles, No E-mail, etc.]. Delayed Job is set up and

Parallel background tasks on single worker dyno

假装没事ソ 提交于 2020-01-05 11:09:27
问题 We've got a Rails app where certain requests trigger long-running tasks on a worker dyno with delayed_job, while the front-end polls until it receives a result. Our traffic is small but growing, and the tasks generally take only a few seconds to complete, but can take up to a minute. Right now a single web and worker dyno each should be sufficient to handle our load. The problem is, the delayed_job queue won't process jobs in parallel, so a longer task ends up holding up the tasks behind it.

jobs is not firing on heroku using hirefire

主宰稳场 提交于 2020-01-05 08:43:16
问题 i'm using gem "delayed_job_active_record" with hire fire on heroku to run jobs in background.i have also set heroku envirnoment variable using my heroku account. My sequence in gem file is below gem 'delayed_job_active_record' gem 'daemons' gem 'hirefire' it is working in local envirnoment in development as production as well. But jobs not firing on heroku from delayed job table. First i try with no config file hirefire.rb in intilizer but no succes. After i add and put this code below.

Delayed job exclude queue

核能气质少年 提交于 2020-01-03 13:10:17
问题 I have a delayed job queue which contains particularly slow running tasks, which I want to be crunched by its own set of dedicated workers, so there is less risk it'll bottleneck the rest of the worker pipeline. RAILS_ENV=production script/delayed_job --queue=super_slow_stuff start However I then also want a general worker pool for all other queues, hopefully without having to specify them seperately (as their names etc are often changed/added too). Something akin to: RAILS_ENV=production

Delay sending an email using Mandrill send_at or Celery countdown/eta

混江龙づ霸主 提交于 2020-01-02 08:11:12
问题 I commonly send transactional emails in response to certain actions on my website, some of which I delay sending by a couple of hours. The function that actually queues the email is a Celery task function called with .delay() that eventually makes an API call to Mandrill using djrill. I discovered that Mandrill offers a send_at parameter when sending an email that will have Mandrill delay sending the email until the specified time. Celery also offers eta or countdown parameters when calling