• Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/retargeting/internals/queue.php
  • Класс: BitrixSeoRetargetingInternalsQueueTable
  • Вызов: QueueTable::processQueueAutoRemoveAgent
static function processQueueAutoRemoveAgent()
{
	$queueDb = static::getList(array(
		'select' => array('ID'),
		'filter' => array('=ACTION' => self::ACTION_AUTO_REMOVE),
		'limit' => 1
	));
	if ($queueDb->fetch())
	{
		$connection = Application::getConnection();
		$sql = "UPDATE " . self::getTableName() . " " .
			"SET ACTION='" . self::ACTION_REMOVE . "' " .
			"WHERE ACTION='" . self::ACTION_AUTO_REMOVE . "' " .
			"AND DATE_AUTO_REMOVE <= " . $connection->getSqlHelper()->getCurrentDateTimeFunction();
		$connection->query($sql);
		if ($connection->getAffectedRowsCount() > 0)
		{
			$types = Service::getTypes();
			foreach ($types as $type)
			{
				static::addQueueAgent($type);
			}
		}

		return static::processQueueAutoRemoveAgentName();
	}
	else
	{
		return '';
	}
}