refactor: 移除冗余日志记录,优化代码可读性

This commit is contained in:
kuaifan
2026-01-14 09:41:06 +00:00
parent 3a2b7b1400
commit dd20711c04
6 changed files with 4 additions and 55 deletions

View File

@@ -144,10 +144,6 @@ class ManticoreTask
{
// 防止无限递归深度超过10层或循环引用
if ($depth > 10 || in_array($task->id, $visited)) {
Log::warning('ManticoreTask: getAllowedUsers recursion limit reached', [
'task_id' => $task->id,
'depth' => $depth,
]);
return [];
}
$visited[] = $task->id;
@@ -280,7 +276,6 @@ class ManticoreTask
// 限制内容长度
return mb_substr($text, 0, self::MAX_CONTENT_LENGTH);
} catch (\Exception $e) {
Log::warning('Get task content error: ' . $e->getMessage(), ['task_id' => $task->id]);
return '';
}
}
@@ -568,7 +563,6 @@ class ManticoreTask
// 4. 批量获取 embedding
$result = AI::getBatchEmbeddings($texts);
if (!Base::isSuccess($result) || empty($result['data'])) {
Log::warning('ManticoreTask: Batch embedding failed', ['task_ids' => $ids]);
continue;
}
@@ -587,13 +581,6 @@ class ManticoreTask
if (!empty($vectorData)) {
$batchCount = ManticoreBase::batchUpdateTaskVectors($vectorData);
$successCount += $batchCount;
if ($batchCount < count($vectorData)) {
Log::warning('ManticoreTask: Some vector updates failed', [
'expected' => count($vectorData),
'actual' => $batchCount,
]);
}
}
}