* [perf story #69170] Adjust for batch cancel.

This commit is contained in:
wangyidong
2024-11-11 10:17:49 +08:00
committed by 孙广明
parent e2bd232bcc
commit 894dbc62e9
4 changed files with 8 additions and 11 deletions
+4 -4
View File
@@ -798,8 +798,8 @@ class task extends control
{
if(!in_array($task->status, $this->config->task->unfinishedStatus)) continue;
$task = $this->taskZen->buildTaskForCancel($task);
$this->task->cancel($task);
$taskData = $this->taskZen->buildTaskForCancel($task);
$this->task->cancel($task, $taskData);
}
}
@@ -840,7 +840,7 @@ class task extends control
}
/* Skip parent task when batch close task. */
if($task->parent == '-1')
if($task->isParent)
{
$parentTasks[$taskID] = $taskID;
continue;
@@ -967,7 +967,7 @@ class task extends control
public function delete(int $executionID, int $taskID, string $from = '')
{
$task = $this->task->getByID($taskID);
if($task->parent == '-1') return $this->send(array('result' => 'fail', 'message' => $this->lang->task->cannotDeleteParent));
if($task->isParent) return $this->send(array('result' => 'fail', 'message' => $this->lang->task->cannotDeleteParent));
$this->task->delete(TABLE_TASK, $taskID);
if($task->parent > 0)
+2 -5
View File
@@ -2651,13 +2651,10 @@ class taskModel extends model
{
foreach($tasks as &$task)
{
$task = $this->processTask($task);
$task = $this->processTask($task, false);
if(!empty($task->children))
{
foreach($task->children as &$child)
{
$child = $this->processTask($child);
}
foreach($task->children as &$child) $child = $this->processTask($child, false);
}
}
+1 -1
View File
@@ -102,7 +102,7 @@ if($isMultiple)
}
$leftBox = '';
if($task->parent != '-1')
if($task->isParent == '0')
{
$leftBox = formGroup(
set::width('1/2'),
+1 -1
View File
@@ -65,7 +65,7 @@
<?php endif;?>
</td>
</tr>
<?php if($task->parent != '-1'):?>
<?php if($task->isParent == '0'):?>
<tr>
<th><?php echo $lang->task->left;?></th>
<td>