Skip to content
This repository
Browse code

fixing SQL syntax.

  • Loading branch information...
commit 98420570498cc19d8b57546b58d12767703d40db 1 parent 944c558
Jeremy Ashkenas authored March 07, 2011

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/cloud_crowd/models/work_unit.rb
2  lib/cloud_crowd/models/work_unit.rb
@@ -81,7 +81,7 @@ def self.distribute_to_nodes
81 81
     # were none available.
82 82
     def self.reserve_available(options={})
83 83
       reservation = ActiveSupport::SecureRandom.random_number(MAX_RESERVATION)
84  
-      conditions = "reservation is null and worker_pid is null and status is #{INCOMPLETE} and #{options[:conditions]}"
  84
+      conditions = "reservation is null and worker_pid is null and status in (#{INCOMPLETE.join(',')}) and #{options[:conditions]}"
85 85
       any = WorkUnit.update_all("reservation = #{reservation}", conditions, options) > 0
86 86
       any && reservation
87 87
     end

0 notes on commit 9842057

Please sign in to comment.
Something went wrong with that request. Please try again.