Updated: Comment #0


According to documentation:

This hook asks your module to clear all of its static caches, in order to ensure a clean environment for subsequently invoked data rebuilds.

We do not invoke data rebuilds by system_cron() but drupal_flush_all_caches().

Proposed resolution

Remove the invocation in system_cron().

Remaining tasks

Review, commit.

User interface changes


API changes

hook_cache_flush() is not invoked by system_cron(). This is also the documented behavior:

This hook is invoked by drupal_flush_all_caches(). It runs before module data is updated and before hook_rebuild().

For 7.x and hook_flush_caches() #710874: Add optional argument to hook_flush_caches() so that cron runs can be identified

remove_system_cron_cache_flush.patch468 bytesolli
PASSED: [[SimpleTest]]: [MySQL] 58,382 pass(es). View


catch’s picture

Status: Needs review » Reviewed & tested by the community

Hmm good catch. The line just below this handles garbage collection for cache bins, which is all hook_flush_caches() was originally intended for.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed a4870dd and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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