#add git monitor

This commit is contained in:
2025-12-18 10:18:25 +08:00
parent 2ec44b5665
commit 5f6bba1d9f
18 changed files with 889 additions and 20 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Console\Commands;
use App\Services\GitMonitorService;
use Illuminate\Console\Command;
class GitMonitorCacheCommand extends Command
{
protected $signature = 'git-monitor:cache';
protected $description = '刷新 release 版本缓存,保存到 configs 表';
public function handle(GitMonitorService $monitor): void
{
$cache = $monitor->refreshReleaseCache(true);
if (empty($cache)) {
$this->warn('未获取到任何 release 版本信息,请检查配置。');
return;
}
$this->info(sprintf(
'已缓存 %d 个仓库的 release 分支信息。',
count($cache['repositories'] ?? [])
));
}
}