CBitrixCloudCDN::updateConfig: Bitrix method

      
<?php 
//  CBitrixCloudCDN :: updateConfig()
//  /dist/bitrix/modules/bitrixcloud/classes/general/cdn.php:130

    
private static function updateConfig()
    {
        if (!
self::$config->lock())
            return 
true;

        
$delayExpiration true;
        try
        {
            try
            {
                
self::$config CBitrixCloudCDNConfig::getInstance()->loadRemoteXML();
                
self::$config->saveToOptions();
                
self::$config->unlock();
            }
            catch(
CBitrixCloudException $e)
            {
                
//In case of documented XML error we'll disable CDN
                
if($e->getErrorCode() !== "")
                {
                    
self::SetActive(false);
                    
$delayExpiration false;
                }
                throw 
$e;
            }
        }
        catch (
Exception $e)
        {
            if (
$delayExpiration)
            {
                
self::$config->setExpired(time() + 1800);
            }

            
CAdminNotify::Add(array(
                
"MESSAGE" => GetMessage("BCL_CDN_NOTIFY", array(
                    
"#HREF#" => "/bitrix/admin/bitrixcloud_cdn.php?lang=".LANGUAGE_ID,
                )),
                
"TAG" => "bitrixcloud_off",
                
"MODULE_ID" => "bitrixcloud",
                
"ENABLE_CLOSE" => "Y",
            ));
            
self::$config->unlock();
            return 
false;
        }

        
self::$config->unlock();

        
//Web service were disabled
        
if (!self::$config->isActive())
        {
            
//By traffic quota
            
if ( self::$config->getQuota()->getTrafficSize() > self::$config->getQuota()->getAllowedSize() )
            {
                
self::$config->setExpired(time() + 1800);
                
CAdminNotify::Add(array(
                    
"MESSAGE" => GetMessage("BCL_CDN_NOTIFY_QUOTA_LIMIT"),
                    
"TAG" => "bitrixcloud_off",
                    
"MODULE_ID" => "bitrixcloud",
                    
"ENABLE_CLOSE" => "N",
                ));
                
self::$config->unlock();
                return 
false;
            }
            
//Or by license
            
elseif ( self::$config->getQuota()->isExpired() )
            {
                
self::$config->setExpired(time() + 1800);
                
CAdminNotify::Add(array(
                    
"MESSAGE" => GetMessage("BCL_CDN_NOTIFY_QUOTA_EXPIRED"),
                    
"TAG" => "bitrixcloud_off",
                    
"MODULE_ID" => "bitrixcloud",
                    
"ENABLE_CLOSE" => "N",
                ));
                
self::$config->unlock();
                return 
false;
            }
        }

        
CAdminNotify::DeleteByTag("bitrixcloud_off");
        return 
true;
    }