deploy: auto commit server changes 2026-06-11 20:44:36

This commit is contained in:
hajimi
2026-06-11 20:44:36 +08:00
parent 9fb80f951a
commit e17a9832af
11 changed files with 1195 additions and 23 deletions
@@ -0,0 +1,49 @@
<?php
namespace app\common\command;
use app\common\service\ai\KbRedisQueueService;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\console\input\Option;
class KbEnqueueRecent extends Command
{
protected function configure()
{
$this->setName('kb:enqueue-recent')
->setDescription('扫描最近更新内容并写入AI知识库Redis队列')
->addOption('limit', null, Option::VALUE_OPTIONAL, '每个来源最多扫描数量', 1000)
->addOption('minutes', null, Option::VALUE_OPTIONAL, '扫描最近多少分钟更新的数据', 30);
}
protected function execute(Input $input, Output $output)
{
$limit = max(1, (int) $input->getOption('limit'));
$minutes = max(1, (int) $input->getOption('minutes'));
$summary = KbRedisQueueService::enqueueRecent($limit, $minutes);
foreach ($summary['targets'] as $label => $target) {
$output->writeln(sprintf(
'[kb:enqueue-recent] %s scanned=%d queued=%d deduped=%d',
$label,
(int) $target['scanned'],
(int) $target['queued'],
(int) $target['deduped']
));
}
$output->writeln(sprintf(
'[kb:enqueue-recent] stream=%s scanned=%d queued=%d deduped=%d limit=%d minutes=%d',
$summary['stream'],
(int) $summary['scanned'],
(int) $summary['queued'],
(int) $summary['deduped'],
(int) $summary['limit'],
(int) $summary['minutes']
));
return 0;
}
}