mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2026-01-03 11:34:51 +01:00
Moved API run call to queue
Now doesn't take like 60 seconds to run a speedtest from the API. Leaving it standard in the artisan command
This commit is contained in:
@@ -5,9 +5,11 @@ namespace App\Helpers;
|
||||
use App\Speedtest;
|
||||
|
||||
class SpeedtestHelper {
|
||||
public static function runSpeedtest()
|
||||
public static function runSpeedtest($output = false)
|
||||
{
|
||||
$output = shell_exec('speedtest-cli');
|
||||
if($output === false) {
|
||||
$output = shell_exec('speedtest-cli');
|
||||
}
|
||||
$output = preg_replace("/\r|\n/", "", $output);
|
||||
|
||||
$pattern = '/([0-9\.]{1,}) ms.*Download: ([0-9\.]{1,} [A-Za-z]{1,}\/s).*Upload: ([0-9\.]{1,} [A-Za-z]{1,}\/s)/';
|
||||
|
||||
Reference in New Issue
Block a user