38 $this->
logger = $DIC->logger()->bgtk();
39 $this->
lng = $DIC->language();
40 $this->
lng->loadLanguageModule(
'background_tasks');
41 $this->persistence =
$DIC->backgroundTasks()->persistence();
48 return $this->
lng->txt(
'background_task_garbage_collection');
53 return $this->
lng->txt(
'background_task_garbage_collection_info');
58 return 'background_task_garbage_collection';
73 return JobScheduleType::IN_HOURS;
83 $this->
logger->debug(
'Starting background task garbage collector..');
86 $this->persistence->garbageCollection();
87 }
catch (Exception
$e) {
88 $this->result->setStatus(JobResult::STATUS_CRASHED);
89 $this->result->setMessage(mb_substr(
"Exc.: {$e->getMessage()} / {$e->getTraceAsString()}", 0, 400));
90 $this->
logger->error(
"Background-Task Garbage Collection execution failed with message: {$e->getMessage()}");
91 $this->
logger->error($e->getTraceAsString());
95 $this->result->
setStatus(JobResult::STATUS_OK);
Garbage collection for BackgroundTasks.
getDefaultScheduleValue()
hasAutoActivation()
Is to be activated on "installation", does only work for ILIAS core cron jobs.
Component logger with individual log levels by component id.