Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/thoughtbot/spawn into thoug…
Browse files Browse the repository at this point in the history
…htbot/master
  • Loading branch information
tra committed Jan 9, 2009
2 parents 0451680 + fa7d629 commit e32aa2d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/spawn.rb
Expand Up @@ -41,12 +41,7 @@ def spawn(options = {})
if options[:method] == :yield || @@method == :yield
yield
elsif options[:method] == :thread || (options[:method] == nil && @@method == :thread)
if ActiveRecord::Base.allow_concurrency
thread_it(options) { yield }
else
@@logger.error("spawn(:method=>:thread) only allowed when allow_concurrency=true")
raise "spawn requires config.active_record.allow_concurrency=true when used with :method=>:thread"
end
thread_it(options) { yield }
else
fork_it(options) { yield }
end
Expand Down

0 comments on commit e32aa2d

Please sign in to comment.