• Модуль: clouds
  • Путь к файлу: ~/bitrix/modules/clouds/classes/mysql/storage_bucket.php
  • Класс: CAllCloudStorageBucket
  • Вызов: CAllCloudStorageBucket::DecFileCounter
function DecFileCounter($file_size = 0.0)
{
	global $DB, $CACHE_MANAGER;
	$res = $DB->Query("
		UPDATE b_clouds_file_bucket
		SET FILE_COUNT = case when FILE_COUNT - 1 >= 0 then FILE_COUNT - 1 else 0 end
		,FILE_SIZE = case when FILE_SIZE - ".roundDB($file_size)." >= 0 then FILE_SIZE - ".roundDB($file_size)." else 0 end
		WHERE ID = ".$this->GetActualBucketId()."
	");

	if (defined("BX_CLOUDS_COUNTERS_DEBUG"))
		CCloudsDebug::getInstance()->endAction();

	if ($file_size)
		COption::SetOptionString("main_size", "~cloud", intval(COption::GetOptionString("main_size", "~cloud")) - $file_size);

	if(CACHED_b_clouds_file_bucket !== false)
		$CACHE_MANAGER->CleanDir("b_clouds_file_bucket");
	return $res;
}