| Conditions | 5 |
| Paths | 6 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | function aggregator2_hook_cron(array &$croninfo): void |
||
| 16 | { |
||
| 17 | Assert::keyExists($croninfo, 'summary'); |
||
| 18 | Assert::keyExists($croninfo, 'tag'); |
||
| 19 | |||
| 20 | $cronTag = $croninfo['tag']; |
||
| 21 | |||
| 22 | $config = Configuration::getConfig('module_aggregator2.php'); |
||
| 23 | $config = $config->toArray(); |
||
| 24 | |||
| 25 | foreach ($config as $id => $c) { |
||
| 26 | if (!isset($c['cron.tag'])) { |
||
| 27 | continue; |
||
| 28 | } |
||
| 29 | if ($c['cron.tag'] !== $cronTag) { |
||
| 30 | continue; |
||
| 31 | } |
||
| 32 | |||
| 33 | try { |
||
| 34 | $a = Aggregator::getAggregator($id); |
||
| 35 | $a->updateCache(); |
||
| 36 | } catch (Exception $e) { |
||
| 37 | $croninfo['summary'][] = 'Error during aggregator2 cacheupdate: ' . $e->getMessage(); |
||
| 38 | } |
||
| 41 |