from __future__ import annotations

import time
from config import AUTOPILOT_INTERVAL_HOURS
from generator import main


def run_forever() -> None:
    interval = max(1, AUTOPILOT_INTERVAL_HOURS) * 3600
    while True:
        print('Iniciando novo ciclo de geração...')
        main()
        print(f'Aguardando {AUTOPILOT_INTERVAL_HOURS} hora(s) para o próximo ciclo...')
        time.sleep(interval)


if __name__ == '__main__':
    run_forever()
