delayed-job

Rails + Delayed Job => email view template does not get updated

孤街浪徒 提交于 2019-12-10 18:05:35
问题 I'm using Rails + Delayed Job for my app. Everytime I update my email view, the server/delayed job does not pick it up. Who's doing the caching? Rails or Delayed Job? any idea how to fix it?.. Other info: - I tried restarting delayed job and it still does not help Thanks 回答1: An old version of the worker might be running the job. Make sure all instances of delayed_job are killed before starting it. 来源: https://stackoverflow.com/questions/7819609/rails-delayed-job-email-view-template-does-not

How to get fix 'require' errors when setting up delayed_job on Elastic Beanstalk

▼魔方 西西 提交于 2019-12-10 14:47:43
问题 I'm having trouble getting delayed_jobs running on Elastic Beanstalk. I'm using the 64bit Amazon Linux 2014.03 v1.0.0 running Ruby 2.1 (Passenger Standalone) container. This is my config script (delayed_job.config) ... files: "/opt/elasticbeanstalk/hooks/appdeploy/post/99_restart_delayed_job.sh": mode: "000755" owner: root group: root encoding: plain content: | #!/usr/bin/env bash . /opt/elasticbeanstalk/support/envvars cd $EB_CONFIG_APP_CURRENT su -c "RAILS_ENV=production bin/delayed_job -

Hook Before All Delayed Jobs

爱⌒轻易说出口 提交于 2019-12-10 14:39:25
问题 Is it possible to have a method run before ALL delayed_job tasks? Basically, we're trying to make sure that every server that is running delayed_job has the latest instance of our code, so we want to run a method that checks this before every job is run. (We already have the "check" method and use it elsewhere. The question is only about how to call it from delayed_job.) 回答1: You could use an evil twin, which is by definition a hack, but should work. See the comments I added in the code for

Weird exception with delayed_job

 ̄綄美尐妖づ 提交于 2019-12-10 14:22:30
问题 Trying to queue a job with delayed_job as follows: Delayed::Job.enqueue(BackgroundProcess.new(current_user, object)) current_user and object are not nil when I print them out. The weird thing is that sometimes refreshing the page or running the command again works! Here is the exception trace: Delayed::Backend::ActiveRecord::Job Columns (44.8ms) SHOW FIELDS FROM `delayed_jobs` TypeError (wrong argument type nil (expected Data)): /Users/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/yaml.rb:391:in

running delayed_job under monit with ubuntu

六月ゝ 毕业季﹏ 提交于 2019-12-10 11:23:04
问题 I'm struggling to get delayed_job working under rails 3.0.9 (ruby 1.9.2). The only way I have succeeded to run is to tape manualy the command rake jobs:work. But I want that to be automatically started when the rails application is starting. I have installed monit under ubuntu and I configured it to launch a file located in my app. This fails looks like: check process delayed_job with pidfile /home/me/myapp/tmp/pids/delayed_job.pid start program = "/home/me/myapp/script/delayed_job start"

Delayed_job (2.1.4) error: Job failed to load: instance of IO needed. Handler nil

不想你离开。 提交于 2019-12-09 23:59:37
问题 I created a simplistic achievements system and wanted to introduce delayed_job (2.1.4) to take care of the processing. However, the handler column in the delayed_jobs table is always nil, which results in the last_error text: Job failed to load: instance of IO needed. Handler nil Here is my setup: Achievement Observer class AchievementObserver < ActiveRecord::Observer observe User, Comment, ... def after_create(record) # initiate delayed job to check conditions Delayed::Job.enqueue(TrophyJob

Configuring Delayed Jobs with Capistrano and Rails 4

﹥>﹥吖頭↗ 提交于 2019-12-08 17:05:28
问题 I am trying to get Capistrano to start/stop Delayed Jobs with a Rails 4 application. I followed the instructions here, but it says Rails 3. This is how its configured now: deploy.rb: require 'delayed/recipes' after "deploy:start", "delayed_job:start" after "deploy:stop", "delayed_job:stop" after "deploy:restart", "delayed_job:stop","delayed_job:start" When I try to deploy I get the following error after it tries to execute RAILS_ENV=production script/delayed_job stop sh: script/delayed_job:

Repeatable job for Laravel json api

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 15:22:35
I am writing Laravel json API on MySQL. Imagine user creates record inside my database. What I want to do is perform some kind of operation 24 hours after this record is created. I can achieve this using : AfterInsertJob::dispatch()->delay(now()->addHours(24)); . But I need to perform this operation again and again until record exists. So how can I do that? Should I dispatch job inside job? I mean Should I dispatch AfterInsertJob inside AfterInsertJob ? I could use Schedule but then how to stop that schedule from AfterInsertJob ? you can in AfterInsertJob->handle, on execution, create new

How to send all email from a Rails app asynchronously

徘徊边缘 提交于 2019-12-08 12:05:33
问题 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. 回答1: Delayed job mailer looks like a good fit for what you want to do. 来源: https://stackoverflow.com/questions/3700788/how-to-send-all-email-from-a-rails-app-asynchronously

Rails background image upload

假装没事ソ 提交于 2019-12-08 10:50:48
问题 I'm using "carrierwave" gem for uploading image files and also "carrierwave backgrounder" to process the uploading + processing the image with RMagick in the background (I use Delayed Job for this). Everything works like a charm. Except one thing - I want to upload the images and show them right under the upload form (so ,everything happens on the same page). So, basically, what happens - since the uploading and image-processing are relatively slow, by the time the page has been rendered