Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
use App\Events\SpeedtestFailed;
use App\Jobs\Influxdb\v2\WriteResult;
use App\Settings\DataIntegrationSettings;
use Illuminate\Events\Dispatcher;

class DataIntegrationSubscriber
class ProcessSpeedtestDataIntegrations
{
/**
* Create the event listener.
Expand All @@ -20,23 +19,10 @@ public function __construct(
/**
* Handle the event.
*/
public function handle(object $event): void
public function handle(SpeedtestCompleted|SpeedtestFailed $event): void
{
if ($this->settings->influxdb_v2_enabled) {
WriteResult::dispatch($event->result);
}
}

/**
* Register the listeners for the subscriber.
*
* @return array<string, string>
*/
public function subscribe(Dispatcher $events): array
{
return [
SpeedtestCompleted::class => 'handleSpeedtestCompleted',
SpeedtestFailed::class => 'handleSpeedtestFailed',
];
}
}