[dokuwiki] advise_after and INDEXER_TASKS_RUN

Hello,

I am interested why advise_after for the INDEXER_TASKS_RUN event is only
called when all tasks return true. Code in question is lines 37-45 in
lib7exe/indexer.php:

$evt = new Doku_Event('INDEXER_TASKS_RUN', $tmp);
if ($evt->advise_before()) {
  runIndexer() or 
  metaUpdate() or 
  runSitemapper() or 
  runTrimRecentChanges() or 
  $evt->advise_after();
}

For example the runTrimRecentChanges returns true only once a day. This
means that advise_after is only called once a day at most. I would like to
write an action plugin that uses up to date page metadata - but when I use
advise_after, it will only be called once a day. 

The workaround now is to use advise_before and call metaUpdate from my
plugin. But I'm interested in the rationale behind the decision to write the
event handling like it is now and not like this:

$evt = new Doku_Event('INDEXER_TASKS_RUN', $tmp);
if ($evt->advise_before()) {
  runIndexer() or 
  metaUpdate() or 
  runSitemapper() or 
  runTrimRecentChanges(); 
  $evt->advise_after();
}

Greetings,

Gabriel

-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: