mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-24 06:28:27 +01:00
Now doesn't take like 60 seconds to run a speedtest from the API. Leaving it standard in the artisan command
38 lines
724 B
PHP
38 lines
724 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Helpers\SpeedtestHelper;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class SpeedtestJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$output = shell_exec('speedtest-cli');
|
|
|
|
return SpeedtestHelper::runSpeedtest($output);
|
|
}
|
|
}
|