• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/integration/recyclebin/autoremovetaskagent.php
  • Класс: BitrixTasksIntegrationRecyclebinAutoRemoveTaskAgent
  • Вызов: AutoRemoveTaskAgent::execute
public function execute(): string
{
	// check if recyclebin module is loaded
	if (!Loader::includeModule('recyclebin'))
	{
		return '';
	}
	// check if another agent is processing
	if ($this->isProcessing())
	{
		return $this->getAgentName();
	}

	$this->startProcessing();
	$this->repository->removeTasksFromRecycleBin(
		new TasksMaxDaysInRecycleBin(),
		new TasksMaxToRemoveFromRecycleBin()
	);
	$this->stopProcessing();

	return $this->getAgentName();
}