123456789101112131415161718192021222324252627 |
- <?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(__('----「:job」Completed, Used :time seconds ----', ['job' => $this->description, 'time' => $jobTime]));
- }
- }
|