delayed-job

Create an excel in delayed job method using axlsx

耗尽温柔 提交于 2019-12-01 13:39:00
I am trying to generate an excel file in my delayed job method in model. which is working fine in local. i'm using scheduler to run delayed jobs in heroku. Jobs are getting finished successfully without generating excel. my delayed job method looks like: def self.generate_excel Axlsx::Package.new do |p| p.workbook.add_worksheet(:name => "Stock Details") do |sheet| sheet.add_row ["S.No", "ProductId", "Title"] products.each_with_index do |prods, index| sheet.add_row ["1", "1234", "product title"] end end p.serialize("#{Rails.root}/app/views/stock_details/stock_details.xlsx") end I'm using

Rails / delayed_job - want to load newest version of job class

梦想与她 提交于 2019-12-01 13:02:27
I'm using the delayed_job plugin in Rails to do background processing, and I'm experiencing a hiccup in the 'agile development' I've been experiencing so far in Rails... Usually in rails if I hit an error / want to add some new functionality - I just add some code and refresh the page and the new code runs. With delayed_job, it seems like the job class isn't being reloaded... if a job fails and I go and fix the error and fire the job again, the old code runs again. Is there any way to make delayed_job load the newest version of the job class before invoking it? Just in case this has anything

Initialize the Delayed Jobs gem by starting the workers on application start

拟墨画扇 提交于 2019-12-01 12:22:32
I am using Ruby on Rails 3.0.9 and I am trying to setup the delay_job gem. All works if, after rebooting the Apache2 server, I run in the Terminal\Console following commands: RAILS_ENV=development script/delayed_job stop RAILS_ENV=development script/delayed_job -n 2 start However, since I always want to start the workers on application start, in my config/initializers/delayed_job.rb I add the following code (that handles both development and production mode): if Rails.env.development? system 'RAILS_ENV=development script/delayed_job stop' system 'RAILS_ENV=development script/delayed_job -n 2

Create an excel in delayed job method using axlsx

耗尽温柔 提交于 2019-12-01 12:02:07
问题 I am trying to generate an excel file in my delayed job method in model. which is working fine in local. i'm using scheduler to run delayed jobs in heroku. Jobs are getting finished successfully without generating excel. my delayed job method looks like: def self.generate_excel Axlsx::Package.new do |p| p.workbook.add_worksheet(:name => "Stock Details") do |sheet| sheet.add_row ["S.No", "ProductId", "Title"] products.each_with_index do |prods, index| sheet.add_row ["1", "1234", "product title

Rails / delayed_job - want to load newest version of job class

旧巷老猫 提交于 2019-12-01 12:00:24
问题 I'm using the delayed_job plugin in Rails to do background processing, and I'm experiencing a hiccup in the 'agile development' I've been experiencing so far in Rails... Usually in rails if I hit an error / want to add some new functionality - I just add some code and refresh the page and the new code runs. With delayed_job, it seems like the job class isn't being reloaded... if a job fails and I go and fix the error and fire the job again, the old code runs again. Is there any way to make

Delayed_job: Job failed to load: uninitialized constant Syck::Syck

我与影子孤独终老i 提交于 2019-12-01 08:11:21
问题 Here's the error: >> Delayed::Job.find(:last).last_error => {Job failed to load: uninitialized constant Syck::Syck. Handler: \"--- !ruby/struct:Delayed::PerformableMethod \\nobject: &id007 !ruby/object:TryController \\n _action_name: create but I have syck ext installed. Usage: def create_user(name,pass,time) puts "hello" Net::HTTP.get(URI.parse("http://www.example.net/buildtest.php?hao=#{name}&mi=#{pass}&da=#{time}")) end def create delay.create_user("nihao000oei9","1","1") end gem 'delayed

Running delayed_job as a windows service

佐手、 提交于 2019-12-01 06:02:39
I am trying to get delayed_job working as a windows service. I am so thoroughly sick of windows I can't even begin to put it into words, but I am stuck with it for now due to 3rd party dependencies. Running rake jobs:work starts the worker in a console with no problems. I've created an empty windows service to start and shutdown the worker using sc create DelayedJobWorker... . However, I can't get the service to start and stop the worker. I'm not sure what the best approach is - what I should be parameterising the service with / asking it to call. Any suggestions gratefully appreciated.

Ruby on Rails Delayed Job Local Wont Run

邮差的信 提交于 2019-12-01 04:58:40
问题 I'm working with delayed job for active record gem https://github.com/collectiveidea/delayed_job I'm trying to set up a job to run five minutes after an event occurs in my application. After five minutes passes, I need to make some database updates. I've tried rake jobs:work and RAILS_ENV=development script/delayed_job start. Prior to this all, I have run bundle install, rails generate delayed_job:active_record, and rake db:migrate. I have a lottery website that needs to check winners every

rvm monit delayed_job

杀马特。学长 韩版系。学妹 提交于 2019-12-01 01:04:45
I am trying to run delayed_job using monit, but its failing to run as rvm's paths (local rvm installation per user basis) are not available to the command. My application is a rails2 app with bundler. Monit is not able to find bundler. Does anyone have any suggestions as to how i can tell about the rvm paths to monit? I am getting the error [rails@x-rws1 current]$ monit start delayed_job -c config/delayed_job.monitrc 'delayed_job' start: /usr/bin/env 'delayed_job' failed to start no such file to load -- bundler /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'

model classes not loading in Delayed Job when using threadsafe

☆樱花仙子☆ 提交于 2019-12-01 00:48:07
问题 I've got an app that has been working well for a long time. I'm turning on threadsafe!, and now Delayed Job is not working, saying it can't find one of my model files. Job failed to load: undefined class/module Foo This isn't a custom job class I have defined in /lib, this is a model file in app/models what could be causing this class to not be loaded? 回答1: As posted on the issue you logged, in case others find this SO post first: I just hit this problem as well... and here's what I found: