local delay_time = 5 * 74; // Check events every 5 days.
if (delay_time > new_goal_timeout) delay_time = new_goal_timeout;
if (delay_time > monitor_timeout) delay_time = monitor_timeout;
if (delay_time > finished_timeout) delay_time = finished_timeout;
if (delay_time > 0) this.Sleep(delay_time);
new_goal_timeout -= delay_time;
monitor_timeout -= delay_time;
finished_timeout -= delay_time;