X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FVersionCheck.php;h=fbb05a1929c9cc1efad57f47d06c2bea49279082;hb=dc7f057aa1428750d240634af100a20a11ab9cbe;hp=0b3b9fa4607c11d8d1f643cbdfc4145ccd99d223;hpb=dbbe381a9dddd433bf0fe56f8dece25908da2d47;p=civicrm-core.git diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index 0b3b9fa460..fbb05a1929 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -74,9 +74,10 @@ class CRM_Utils_VersionCheck { /** * Self-populates version info * - * @throws \Exception + * @param bool $force + * @throws Exception */ - public function initialize() { + public function initialize($force = FALSE) { $this->getJob(); // Populate remote $versionInfo from cache file @@ -84,9 +85,9 @@ class CRM_Utils_VersionCheck { // Fallback if scheduled job is enabled but has failed to run. $expiryTime = time() - self::CACHEFILE_EXPIRE; - if (!empty($this->cronJob['is_active']) && + if ($force || (!empty($this->cronJob['is_active']) && (!$this->isInfoAvailable || filemtime($this->cacheFile) < $expiryTime) - ) { + )) { // First try updating the files modification time, for 2 reasons: // - if the file is not writeable, this saves the trouble of pinging back // - if the remote server is down, this will prevent an immediate retry