Permalink
Browse files

fixing SQL syntax.

  • Loading branch information...
jashkenas committed Mar 7, 2011
1 parent 944c558 commit 98420570498cc19d8b57546b58d12767703d40db
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/cloud_crowd/models/work_unit.rb
@@ -81,7 +81,7 @@ def self.distribute_to_nodes
# were none available.
def self.reserve_available(options={})
reservation = ActiveSupport::SecureRandom.random_number(MAX_RESERVATION)
- conditions = "reservation is null and worker_pid is null and status is #{INCOMPLETE} and #{options[:conditions]}"
+ conditions = "reservation is null and worker_pid is null and status in (#{INCOMPLETE.join(',')}) and #{options[:conditions]}"
any = WorkUnit.update_all("reservation = #{reservation}", conditions, options) > 0
any && reservation
end

0 comments on commit 9842057

Please sign in to comment.