This commit is contained in:
wyn
2026-05-26 19:02:37 +08:00
parent 3d6cfaaed1
commit 1fcd6a129d
4 changed files with 81 additions and 66 deletions

View File

@@ -58,7 +58,7 @@ class ReferenceCheckTwo
return;
}
// if (intval($row['status']) === 1) {
// if (intval($row['status']) === ReferenceCheckService::RECORD_COMPLETED) {
// $job->delete();
// return;
// }
@@ -95,12 +95,12 @@ class ReferenceCheckTwo
: '[Crossref复核-无摘要]';
$reason = $tag . ' ' . (isset($llmResult['reason']) ? $llmResult['reason'] : '');
// LLM 通讯失败:写 status=2 并抛异常触发队列重试
// LLM 通讯失败:写 status=RECORD_FAILED(3) 并抛异常触发队列重试
if ($requestFailed) {
$svc->updateCheckResult($checkId, [
'confidence' => floatval($llmResult['confidence']),
'reason' => $reason,
'status' => 2,
'status' => ReferenceCheckService::RECORD_FAILED,
'error_msg' => isset($llmResult['reason']) ? $llmResult['reason'] : 'LLM request failed',
]);
throw new \RuntimeException(isset($llmResult['reason']) ? $llmResult['reason'] : 'LLM request failed');
@@ -111,7 +111,7 @@ class ReferenceCheckTwo
'is_match' => $canSupport ? 1 : 0,
'confidence' => floatval($llmResult['confidence']),
'reason' => $reason,
'status' => 1,
'status' => ReferenceCheckService::RECORD_COMPLETED,
'error_msg' => '',
]);
$this->oQueueJob->log("Crossref复核写入 id={$checkId} affected={$affected} can_support=" . ($canSupport ? 1 : 0) . " confidence=" . floatval($llmResult['confidence']));
@@ -148,7 +148,7 @@ class ReferenceCheckTwo
$row = Db::name('article_reference_check_result')->where('id', $checkId)->find();
try {
(new ReferenceCheckService())->updateCheckResult($checkId, [
'status' => 2,
'status' => ReferenceCheckService::RECORD_FAILED,
'error_msg' => $msg,
]);
} catch (\Exception $e) {