Skip to content

Instantly share code, notes, and snippets.

@ngw
Created March 14, 2011 15:02
Show Gist options
  • Save ngw/869265 to your computer and use it in GitHub Desktop.
Save ngw/869265 to your computer and use it in GitHub Desktop.
## 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
@leshill
Copy link

leshill commented Mar 14, 2011

Quick thing to help clarify: debug and step into line 5

@ngw
Copy link
Author

ngw commented Mar 14, 2011

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.

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