Created
March 14, 2011 15:02
-
-
Save ngw/869265 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## call to enqueue, doesn't even write on redis | |
def create | |
if @portfolio = current_user.create_portfolio( params[ :portfolio ] ) | |
Resque.enqueue( PortfolioGenerator, current_user.subdomain ) | |
redirect_to root_path | |
else | |
render :new | |
end | |
end | |
## calling Job directly, this one works as expected | |
def create | |
if @portfolio = current_user.create_portfolio( params[ :portfolio ] ) | |
Resque::Job.create( :portfolio_generation, PortfolioGenerator, current_user.subdomain ) | |
redirect_to root_path | |
else | |
render :new | |
end | |
end | |
## Job | |
module PortfolioGenerator | |
@queue = 'portfolio_generation' | |
def self.perform subdomain | |
puts subdomain | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
leshill, sorry for the fuss, you can close the issue.
The problem is that resque_spec was included by mistake in dev env and not only in test, and it obviously didn't work.
Sorry for wasting your time.