mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-03 02:58:42 +00:00
29 lines
687 B
PHP
29 lines
687 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(): void
|
|
{
|
|
$startTime = microtime(true);
|
|
|
|
$nodes = Node::whereStatus(1)->whereType(4)->get();
|
|
if ($nodes->isNotEmpty()) {
|
|
ReloadNode::dispatchSync($nodes);
|
|
}
|
|
|
|
$jobTime = round(microtime(true) - $startTime, 4);
|
|
Log::info(__('----「:job」Completed, Used :time seconds ----', ['job' => $this->description, 'time' => $jobTime]));
|
|
}
|
|
}
|