0

I have the Boost and Domain Access modules working correctly. But I've found that if the cache is flushed for one domain it doesn't clear for the others. So if content is added to one, it won't show for others until cron has been run.

Any way to fix this at all?

1
  • How did you resolve this issue? – ARUN Aug 6 '20 at 10:09
1
+50

Saw your post on d.o.: https://www.drupal.org/project/domain/issues/1673650

The suggested fix looks good and should still run:

function MODULENAME_domain_cron($domain) {
  global $base_root;
  if (isset($domain['path'])) {
    $base_root = $domain['path'];
  }
  boost_cron();
}

The error you have there seems strange. The argument should be passed to the hook_domain_cron method ?!?

UPDATE: You still can try to make the argument optional:

function MODULENAME_domain_cron($domain=[])

But I would debug that to find out the real reason .. How does your code look for mymodule_hook_domain_cron?

4
  • I have copy pasted the same code from drupal.org/project/domain/issues/1673650 – ARUN Aug 7 '20 at 9:07
  • To where have you pasted that code? Do you have a module named MODULENAME?? – rémy Aug 7 '20 at 10:23
  • My module name is 'mymodule' and I have pasted the code in to mymodule.module file as below: /* * Implements hook_domain_cron(). */ function mymodule_domain_cron($domain) { global $base_root; if (isset($domain['path'])) { $base_root = $domain['path']; } boost_cron(); } – ARUN Aug 7 '20 at 11:48
  • I've added an update about how to make method arguments optional – rémy Aug 7 '20 at 15:07
-1

I would use use Elysia Cron module.

Elysia Cron extends Drupal standard cron, allowing a fine grain control over each task and several ways to add custom cron jobs to your site.

That way I could leave regular CRON jobs just like they are (or tune them, but this is out of the scope of this question).

I would then set up Boost cron job to run every 5 minutes. There are 2 advantages to that:

  1. You avoid heavy IO hit on your HDD, spreading it all over the day
  2. Your original problem is pretty much solved - 5 minutes cache lag is something you probably can work with all right.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.