Create a gist now

Instantly share code, notes, and snippets.

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"]}]
@drhenner

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

I have no idea why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment