This repository was archived by the owner on Sep 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 "name" : " Dominik Frantisek Bucik" ,
2626 "email" : " bucik@ics.muni.cz"
2727 },
28- {
29- "name" : " Dominik Baranek" ,
30- "email" : " baranek@ics.muni.cz"
31- },
3228 {
3329 "name" : " Dominik Baranek" ,
3430 "email" : " baranek@ics.muni.cz"
3531 }
3632 ],
3733 "require" : {
38- "simplesamlphp/simplesamlphp" : " ~1.17" ,
3934 "simplesamlphp/composer-module-installer" : " ~1.0" ,
4035 "symfony/var-exporter" : " ^5.0" ,
4136 "phpseclib/phpseclib" : " ~3.0" ,
Original file line number Diff line number Diff line change 99 * Hook to run a cron job.
1010 *
1111 * @param array $croninfo Output
12- * @author Dominik Baranek <baranek@ics.muni.cz>
1312 */
1413function perun_hook_cron (&$ croninfo )
1514{
@@ -19,9 +18,15 @@ function perun_hook_cron(&$croninfo)
1918 }
2019 Logger::info ('cron [perun]: Running cron in cron tag [ ' . $ croninfo ['tag ' ] . '] ' );
2120
22- $ challengesDbCmd = new ChallengesDbCmd ();
21+ try {
22+ $ challengesDbCmd = new ChallengesDbCmd ();
2323
24- if (! $ challengesDbCmd ->deleteOldChallenges ()) {
25- Logger::error ('cron [perun]: Error while deleting old challenges from the database. ' );
24+ if (! $ challengesDbCmd ->deleteOldChallenges ()) {
25+ Logger::error ('cron [perun]: Error while deleting old challenges from the database. ' );
26+ }
27+ } catch (\Exception $ e ) {
28+ Logger::info (
29+ 'cron [perun]: Not deleting old challenges from the database because no database is configured or an error occured: ' . $ e ->getMessage ()
30+ );
2631 }
2732}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ private function __construct()
3232 {
3333 $ configuration = Configuration::getConfig (self ::CONFIG_FILE_NAME );
3434
35- $ this ->config = $ configuration ->getConfigItem (self ::DATABASE , null );
35+ $ this ->config = $ configuration ->getConfigItem (self ::DATABASE );
3636 $ this ->store = $ this ->config ->getConfigItem (self ::STORE , null );
3737
3838 $ this ->whitelistTableName = $ this ->config ->getString (self ::WHITELIST_TABLE_NAME , null );
You can’t perform that action at this time.
0 commit comments