public
Created

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
class PortfolioGenerationJob
 
@queue = :generation
 
class << self
def perform subdomain
puts subdomain
end
def before_perform_log *args
Logger.info "Starting"
end
end
end
 
###
 
env = Rails.env || 'development'
config = YAML.load_file( Rails.root.join 'config', 'resque.yml' )
Resque.redis = config[ env ]
 
Dir[ "#{ Rails.root }/app/jobs/*.rb" ].each { |file| require file }
 
###
 
 
[ngw@chienandalusia:~/StyleJam]$ rails c (03-12 22:49)Loading development environment (Rails 3.0.5)
ruby-1.9.2-p180 :001 > Resque.enqueue( PortfolioGenerationJob, 'test' )
=> [{:klass=>PortfolioGenerationJob, :args=>["test"]}]
ruby-1.9.2-p180 :002 > Resque.enqueue( PortfolioGenerationJob, 'test' )
=> [{:klass=>PortfolioGenerationJob, :args=>["test"]}, {:klass=>PortfolioGenerationJob, :args=>["test"]}]
ruby-1.9.2-p180 :003 > Resque.enqueue( PortfolioGenerationJob, 'test' )
=> [{:klass=>PortfolioGenerationJob, :args=>["test"]}, {:klass=>PortfolioGenerationJob, :args=>["test"]}, {:klass=>PortfolioGenerationJob, :args=>["test"]}]
ruby-1.9.2-p180 :004 > Resque.enqueue( PortfolioGenerationJob, 'test' )
=> [{:klass=>PortfolioGenerationJob, :args=>["test"]}, {:klass=>PortfolioGenerationJob, :args=>["test"]}, {:klass=>PortfolioGenerationJob, :args=>["test"]}, {:klass=>PortfolioGenerationJob, :args=>["test"]}]
ruby-1.9.2-p180 :005 > ^D
 
[ngw@chienandalusia:~/StyleJam]$ rails c (03-12 23:05)
Loading development environment (Rails 3.0.5)
ruby-1.9.2-p180 :001 > Resque.enqueue( PortfolioGenerationJob, 'test' )
=> [{:klass=>PortfolioGenerationJob, :args=>["test"]}]

I have a bit different issue... nothing is running but... Resque.enqueue( PortfolioGenerationJob, 'test' ) returns an empty array

I have no idea why?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.