ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
hook_cron.php File Reference

Go to the source code of this file.

Functions

 riak_hook_cron (&$croninfo)
 Hook to run a cron job. More...
 

Function Documentation

◆ riak_hook_cron()

riak_hook_cron ( $croninfo)

Hook to run a cron job.

Parameters
array&$croninfoOutput

Definition at line 31 of file hook_cron.php.

31 {
32 assert(is_array($croninfo));
33 assert(array_key_exists('summary', $croninfo));
34 assert(array_key_exists('tag', $croninfo));
35
36 if ($croninfo['tag'] !== 'hourly') return;
37
38 try {
40 $result = $store->bucket->indexSearch('expires', 'int',
41 1, time() - 30);
42 foreach ($result as $link) {
43 $link->getBinary()->delete();
44 }
45
46 SimpleSAML\Logger::info(sprintf("deleted %s riak key%s",
47 sizeof($result), sizeof($result) == 1 ? '' : 's'));
48 } catch (Exception $e) {
49 $message = 'riak threw exception: ' . $e->getMessage();
51 $croninfo['summary'][] = $message;
52 }
53}
$result
static info($string)
Definition: Logger.php:199
static warning($string)
Definition: Logger.php:177
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Definition: getUserInfo.php:11
$croninfo
Definition: cron.php:23
catch(Exception $e) $message

References $croninfo, $message, $result, $store, SimpleSAML\Logger\info(), and SimpleSAML\Logger\warning().

+ Here is the call graph for this function: