Boost'cache lifetime ignored in Drupal 7: how to solve the problem

Sometime in Drupal 7 the Boost's cache is flushed during the cron without respecting the Boost maximum cache lifetime setting, this happens when the cron is running and there is an attempt to re-run it, something goes wrong and the Boos'ts cache is flushed.

To solve this problem i made that the Boost's hook_cron is executed for last using the function hook_module_implements_alter:

function boost_last_in_cron_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'cron') {
  $module = 'boost';
	$group = $implementations[$module];
	unset($implementations[$module]);
	$implementations[$module] = $group;
  }
}

 

Tags: