import { checkSupervisorAndRespawn } from '../../modules/supervisor-management/usecases/checkSupervisorAndRespawn.usecase.js';
export function startSupervisorScheduler(deps) {
    const runCheck = async () => {
        try {
            await checkSupervisorAndRespawn({
                supervisorGateway: deps.supervisorGateway,
                lockGateway: deps.lockGateway,
                statusStore: deps.statusStore,
                logger: deps.logger,
                now: deps.now,
            });
        }
        catch (error) {
            deps.logger.error({ error }, 'Supervisor scheduler tick failed');
        }
    };
    void runCheck();
    const timer = setInterval(() => {
        void runCheck();
    }, deps.intervalMs);
    return {
        stop: () => clearInterval(timer),
    };
}
//# sourceMappingURL=supervisorScheduler.js.map