Issue #2311273 by jonathan1055, pfrenssen: Tidy up _scheduler_publish() and _scheduler_unpublish().