Files
ProxyPanel/app/Console/Commands/VNetReload.php
兔姬桑 3d1c1d2151 针对VNet进行强化
1. 添加了多IP线路的兼容;
2. 强化用户信息变动 与 VNet信息更新的机制;
3. 修正了节点结构修正后,VNet重置线路异常的问题;
4. 添加VNet线路一键重启命令 `php artisan vnet:reload`。
2022-07-05 22:11:57 +08:00

29 lines
643 B
PHP

<?php
namespace App\Console\Commands;
use App\Jobs\VNet\reloadNode;
use App\Models\Node;
use Illuminate\Console\Command;
use Log;
class VNetReload extends Command
{
protected $signature = 'vnet:reload';
protected $description = 'VNet线路重置';
public function handle()
{
$startTime = microtime(true);
$nodes = Node::whereStatus(1)->whereType(4)->get();
if ($nodes->isNotEmpty()) {
reloadNode::dispatchNow($nodes);
}
$jobTime = round((microtime(true) - $startTime), 4);
Log::info('---【'.$this->description.'】完成---,耗时'.$jobTime.'秒');
}
}