Files
pterodactyl-panel/app/Actions/Telemetry/SendTelemetry.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

31 lines
713 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Actions\Telemetry;
use Exception;
use Illuminate\Support\Facades\Http;
use Pterodactyl\Contracts\Telemetry\SendsTelemetry;
use Pterodactyl\Services\Telemetry\TelemetryCollectionService;
final readonly class SendTelemetry implements SendsTelemetry
{
public function __construct(private TelemetryCollectionService $telemetry) {}
public function send(): void
{
try {
$data = $this->telemetry->collect();
} catch (Exception) {
return;
}
try {
Http::timeout(5)->post('https://telemetry.pterodactyl.io', $data);
} catch (Exception) {
return;
}
}
}