FileChecker::checkAsAgent

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. FileChecker
  4. checkAsAgent
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/ui/webpack/internals/filechecker.php
  • Класс: Bitrix\Crm\UI\Webpack\Internals\FileChecker
  • Вызов: FileChecker::checkAsAgent
static function checkAsAgent(): string
{
	$instance = new self();
	if (!$instance->isEnabled())
	{
		return '';
	}

	$cnt = 0;
	foreach ($instance->getItems() as [$type, $id])
	{
		// limiting the number of processed items per agent
		if ($cnt++ >= self::LIMIT_ITEMS)
		{
			break;
		}

		// remove from queue for preventing processing single item multiple times
		if (!$instance->removeItem($type, $id))
		{
			continue;
		}

		$pack = $instance->createPack($type, $id);

		// check if pack exists
		if (!$pack->hasRow())
		{
			continue;
		}

		// check if file exists
		if ($pack->checkFileExists())
		{
			continue;
		}

		// rebuild file
		$pack->build();
	}

	return $instance->getItems()
		? self::class . '::checkAsAgent();'
		: ''
	;
}

Добавить комментарий