VNetReload.php 641 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Jobs\VNet\reloadNode;
  4. use App\Models\Node;
  5. use Illuminate\Console\Command;
  6. use Log;
  7. class VNetReload extends Command
  8. {
  9. protected $signature = 'vnet:reload';
  10. protected $description = 'VNet线路重置';
  11. public function handle()
  12. {
  13. $startTime = microtime(true);
  14. $nodes = Node::whereStatus(1)->whereType(4)->get();
  15. if ($nodes->isNotEmpty()) {
  16. reloadNode::dispatchNow($nodes);
  17. }
  18. $jobTime = round(microtime(true) - $startTime, 4);
  19. Log::info('---【'.$this->description.'】完成---,耗时'.$jobTime.'秒');
  20. }
  21. }