Skip to content

Commit a760f44

Browse files
committed
unassign agents from tasks they should not work on anymore
1 parent 030e35d commit a760f44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/inc/api/APIGetTask.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ public function execute($QUERY = array()) {
5656
if ($currentTask == null) {
5757
// we checked the task and it is completed
5858
DServerLog::log(DServerLog::TRACE, "No best task available and current assigned task is fullfilled", [$this->agent]);
59+
Factory::getAssignmentFactory()->delete($assignment);
5960
$this->noTask();
6061
}
6162
if (TaskUtils::isSaturatedByOtherAgents($currentTask, $this->agent)) {
63+
Factory::getAssignmentFactory()->delete($assignment);
6264
$this->noTask();
6365
}
6466
// assignment is still good -> send this task
@@ -187,4 +189,4 @@ private function sendTask($task, $assignment) {
187189

188190
$this->sendResponse($response);
189191
}
190-
}
192+
}

0 commit comments

Comments
 (0)