In ScheduledExecutorService, if a task throws an exception and it’s not caught inside the task, the scheduler cancels it automatically.
In my code, the RuntimeException caused the task to stop after the first run.
To fix it, I should catch exceptions inside the task using a try-catch block, so that the scheduler can continue running the task even if an error happens