lib/roby/planning/task.rb in roby-0.7 vs lib/roby/planning/task.rb in roby-0.7.1

- old
+ new

@@ -45,18 +45,20 @@ def to_s "#{super}[#{method_name}:#{method_options}] -> #{@planned_task || "nil"}" end def planned_task - task = planned_tasks.find { true } - if !task && pending? + if success? || result + result + elsif task = planned_tasks.find { true } + task + elsif pending? task = planned_model.new task.planned_by self task.executable = false + task end - - task end # The thread that is running the planner attr_reader :thread # The transaction in which we build the new plan. It gets committed on @@ -101,12 +103,12 @@ end # If the transaction is distributed, and is not proposed to all # owners, do it transaction.propose - transaction.commit_transaction - - @result = result_task + transaction.commit_transaction do + @result = result_task + end end # Polls for the planning thread end poll do if thread.alive?