Skip to content

Commit

Permalink
At begin of loop, clean up work unit's reservations if it has any.
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecvo committed Jul 30, 2010
1 parent f47d9d5 commit f39cc7b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/cloud_crowd/models/work_unit.rb
Expand Up @@ -41,6 +41,7 @@ def self.distribute_to_nodes
reservation = nil
filter = {}
loop do
WorkUnit.cancel_reservations(reservation) if reservation
return unless reservation = WorkUnit.reserve_available(:limit => RESERVATION_LIMIT, :conditions => filter)
work_units = WorkUnit.reserved(reservation)
available_nodes = NodeRecord.available
Expand Down

0 comments on commit f39cc7b

Please sign in to comment.