Skip to content

@ngw /gist:867620
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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
Something went wrong with that request. Please try again.