AmendHub

Download:

jcs

/

subtext

/

amendments

/

432

main: Let binkp poll run if next_poll is 0, even if one is logged in

This should only happen when the sysop triggers it, so let it run

jcs made amendment 432 about 1 year ago
--- main.c Wed Mar 15 15:29:57 2023 +++ main.c Wed Mar 15 17:28:49 2023 @@ -450,11 +450,11 @@ periodic_jobs(struct uthread *uthread, void *arg) for (;;) { date_tm = localtime((time_t *)&Time); - - if (nsessions != 0) - goto sleep; if (last_daily_job != date_tm->tm_mday) { + if (nsessions != 0) + goto sleep; + if (db->config.session_log_prune_days) { session_prune_logs(db->config.session_log_prune_days); uthread_yield(); @@ -473,7 +473,11 @@ periodic_jobs(struct uthread *uthread, void *arg) last_daily_job = date_tm->tm_mday; } - if (binkp_ready) { + if (binkp_ready && (nsessions == 0 || binkp_next_poll == 0)) { + /* + * Only do polling when no one is on, or we were just woken up + * from the sysop menu + */ if (Time > binkp_next_poll) { binkp_poll(); uthread_yield();