mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2026-01-02 19:17:22 +01:00
Moved speedtest logic into interface
This commit is contained in:
35
app/Actions/QueueSpeedtest.php
Normal file
35
app/Actions/QueueSpeedtest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions;
|
||||
|
||||
use App\Helpers\SettingsHelper;
|
||||
use App\Interfaces\SpeedtestProvider;
|
||||
use App\Jobs\SpeedtestJob;
|
||||
use Henrywhitaker3\LaravelActions\Interfaces\ActionInterface;
|
||||
|
||||
class QueueSpeedtest implements ActionInterface
|
||||
{
|
||||
private SpeedtestProvider $speedtestProvider;
|
||||
|
||||
/**
|
||||
* Create a new action instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(SpeedtestProvider $speedtestProvider)
|
||||
{
|
||||
$this->speedtestProvider = $speedtestProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the action.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
SettingsHelper::loadIntegrationConfig();
|
||||
|
||||
SpeedtestJob::dispatch(false, config('integrations'), $this->speedtestProvider);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user