This commit is contained in:
Jürgen Mummert
2025-12-26 21:01:25 +01:00
parent 66c119ad66
commit 7b851001f0
4 changed files with 84 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace MummertMedia\ContaoMeilisearchBundle\Cron;
use Contao\CoreBundle\Framework\ContaoFramework;
use MummertMedia\ContaoMeilisearchBundle\Service\MeilisearchIndexService;
class MeilisearchIndexCron
{
public function __construct(
private readonly MeilisearchIndexService $indexService,
private readonly ContaoFramework $framework,
) {}
public function __invoke(): void
{
// Contao initialisieren (wichtig!)
$this->framework->initialize();
// einmal täglich indexieren
$this->indexService->run();
}
}