修改自动推广的相关任务
This commit is contained in:
@@ -4,7 +4,6 @@ namespace app\api\job;
|
||||
|
||||
use think\queue\Job;
|
||||
use app\common\ExpertFinderService;
|
||||
use app\common\QueueJob;
|
||||
|
||||
/**
|
||||
* 队列任务:用本地大模型从 affiliation 推断国家,写入 expert.country_id / country。
|
||||
@@ -17,16 +16,9 @@ use app\common\QueueJob;
|
||||
*/
|
||||
class FillExpertCountry
|
||||
{
|
||||
private $oQueueJob;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->oQueueJob = new QueueJob();
|
||||
}
|
||||
|
||||
public function fire(Job $job, $data)
|
||||
{
|
||||
$this->oQueueJob->init($job);
|
||||
|
||||
$expertId = intval(isset($data['expert_id']) ? $data['expert_id'] : 0);
|
||||
$affiliation = isset($data['affiliation']) ? trim((string)$data['affiliation']) : '';
|
||||
@@ -35,7 +27,6 @@ class FillExpertCountry
|
||||
|
||||
$service = new ExpertFinderService();
|
||||
|
||||
try {
|
||||
if ($expertId && $affiliation !== '') {
|
||||
$service->fillExpertCountry($expertId, $affiliation, $chatUrl);
|
||||
}
|
||||
@@ -43,12 +34,5 @@ class FillExpertCountry
|
||||
|
||||
// 链式:处理完当前专家立刻拉下一个进来
|
||||
$service->enqueueNextCountryFill(1, $queue, $chatUrl);
|
||||
} catch (\Exception $e) {
|
||||
$this->oQueueJob->handleException($e, $job, "expert_id={$expertId} queue={$queue}");
|
||||
} catch (\Throwable $e) {
|
||||
$this->oQueueJob->handleException($e, $job, "expert_id={$expertId} queue={$queue}");
|
||||
} finally {
|
||||
$this->oQueueJob->finnal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user