We had a problem with nodes published using scheduler not appearing because of the page cache, which required clearing caches on publish. Fortunately this module provides a configuration option to do exactly that! But we didn't find it at first because we're not using the builtin lightweight cron, but instead managing this cron task using elysia cron. We also needed to log scheduler actions to help debug this, but were confused because those also appear in the lightweight cron settings page. But when we started to dig in the code we discovered how to do this. The UX issue is that the options "Log every activation and completion message" and "Clear all expired block and page caches after publishing or unpublishing via cron" should probably be moved to admin/config/content/scheduler from admin/config/content/scheduler/cron to make it clear that they apply regardless of whether lightweight cron is used.

CommentFileSizeAuthor
#3 2947370-3.move-cache-option.patch2.65 KBjonathan1055

Comments

mvc created an issue. See original summary.

jonathan1055’s picture

Hi mvc,
Thanks for raising this. I've checked the code and you are right that the option to clear the cache is effective for both the full Drupal cron run and the Scheduler lightweight cron.

However, the 'Log every activation and completion message.' option is specific to just the lightweight cron. The full drupal cron writes it's own "Cron run completed" log message, so Scheduler only needs this option when not doing the full cron. The log messages are only written out when running the lightweight cron, the option has no effect when doing a full Drupal cron.

So yes I think we should move the cache option to the main page, but the log option will stay where it is. It would also be good to have a specific "cache cleared" message if that is actully done, so that admins can see what is happening.

Jonathan

jonathan1055’s picture

Status: Active » Needs review
Related issues: +#2377201: Introduce an option to cache_clear_all() on Scheduler cron
StatusFileSize
new2.65 KB

Here's a patch which moves the cache-clear option and also writes a dblog watchdog message if the cache is cleared.

For reference: #2377201: Introduce an option to cache_clear_all() on Scheduler cron is the original issue when we added this option. The option is not requied in 8.x so we can fix this just at at 7.x.

mvc’s picture

Status: Needs review » Reviewed & tested by the community

That was fast :)

Ah, I was thinking of the "@Type: scheduled [un]publishing of %title" messages, but I see now that the option just controls the "lightweight cron run activated" message. This patch looks great to me, thanks!

chris matthews’s picture

Would it be possible to commit the patch in #3 to 7.x-1.x-dev and tag a 7.x-1.6 release? Maybe some of the patches that need review can get in this release as well.

  • jonathan1055 committed f8137ac on 7.x-1.x
    Issue #2947370 by jonathan1055: Move "clear cache" option to main...
jonathan1055’s picture

Title: Clarify that options to log actions & clear caches are not specific to lightweight cron » Move "clear cache" option to main Scheduler settings tab
Status: Reviewed & tested by the community » Fixed

Fixed! Sorry about the delay.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.