<?php

declare(strict_types=1);



class CronWorkerController
{
    public static function routes(): void
    {
        Router::get('/cron/catalogue-worker', [self::class, 'run']);
    }

    public static function run(): void
    {
        $slot  = (int) ($_GET['slot'] ?? 0);
        $token = (string) ($_GET['token'] ?? '');
        $chain = (($_GET['chain'] ?? '') === '1');
        CatalogueProcessor::runLoopbackSlot($slot, $token, $chain);  
    }
}
