CBPRestActivity::calculateTimeoutDuration

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPRestActivity
  4. calculateTimeoutDuration
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/restactivity.php
  • Класс: CBPRestActivity
  • Вызов: CBPRestActivity::calculateTimeoutDuration
private function calculateTimeoutDuration()
{
	$timeoutDuration = ($this->IsPropertyExists('TimeoutDuration') ? $this->TimeoutDuration : 0);

	$timeoutDurationType = ($this->IsPropertyExists('TimeoutDurationType') ? $this->TimeoutDurationType : "s");
	$timeoutDurationType = mb_strtolower($timeoutDurationType);
	if (!in_array($timeoutDurationType, ['s', 'd', 'h', 'm']))
	{
		$timeoutDurationType = 's';
	}

	$timeoutDuration = intval($timeoutDuration);
	switch ($timeoutDurationType)
	{
		case 'd':
			$timeoutDuration *= 3600 * 24;
			break;
		case 'h':
			$timeoutDuration *= 3600;
			break;
		case 'm':
			$timeoutDuration *= 60;
			break;
		default:
			break;
	}

	return min($timeoutDuration, 3600 * 24 * 365 * 5);
}

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