<?php

namespace App\Shared\Logging\MessageHandler;

use App\Shared\Logging\LogPruneService;
use App\Shared\Logging\Message\PruneLogsMessage;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
final class PruneLogsHandler
{
    public function __construct(private readonly LogPruneService $pruneService) {}

    public function __invoke(PruneLogsMessage $message): void
    {
        $this->pruneService->pruneByRetention();
    }
}
