當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhabricatorRepository::loadUpdateInterval方法代碼示例

本文整理匯總了PHP中PhabricatorRepository::loadUpdateInterval方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorRepository::loadUpdateInterval方法的具體用法?PHP PhabricatorRepository::loadUpdateInterval怎麽用?PHP PhabricatorRepository::loadUpdateInterval使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhabricatorRepository的用法示例。


在下文中一共展示了PhabricatorRepository::loadUpdateInterval方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: resolveUpdateFuture

 /**
  * @task pull
  */
 private function resolveUpdateFuture(PhabricatorRepository $repository, ExecFuture $future, $min_sleep)
 {
     $monogram = $repository->getMonogram();
     $this->log(pht('Resolving update for "%s".', $monogram));
     try {
         list($stdout, $stderr) = $future->resolvex();
     } catch (Exception $ex) {
         $proxy = new PhutilProxyException(pht('Error while updating the "%s" repository.', $repository->getMonogram()), $ex);
         phlog($proxy);
         return time() + $min_sleep;
     }
     if (strlen($stderr)) {
         $stderr_msg = pht('Unexpected output while updating repository "%s": %s', $monogram, $stderr);
         phlog($stderr_msg);
     }
     // For now, continue respecting this deprecated setting for raising the
     // minimum pull frequency.
     // TODO: Remove this some day once this code has been completely stable
     // for a while.
     $sleep_for = (int) $repository->getDetail('pull-frequency');
     $min_sleep = max($sleep_for, $min_sleep);
     $smart_wait = $repository->loadUpdateInterval($min_sleep);
     $this->log(pht('Based on activity in repository "%s", considering a wait of %s ' . 'seconds before update.', $repository->getMonogram(), new PhutilNumber($smart_wait)));
     return time() + $smart_wait;
 }
開發者ID:denghp,項目名稱:phabricator,代碼行數:28,代碼來源:PhabricatorRepositoryPullLocalDaemon.php

示例2: buildRepositoryUpdateInterval

 private function buildRepositoryUpdateInterval(PhabricatorRepository $repository)
 {
     $smart_wait = $repository->loadUpdateInterval();
     $doc_href = PhabricatorEnv::getDoclink('Diffusion User Guide: Repository Updates');
     return array(phutil_format_relative_time_detailed($smart_wait), " · ", phutil_tag('a', array('href' => $doc_href, 'target' => '_blank'), pht('Learn More')));
 }
開發者ID:patelhardik,項目名稱:phabricator,代碼行數:6,代碼來源:DiffusionRepositoryEditMainController.php

示例3: resolveUpdateFuture

 /**
  * @task pull
  */
 private function resolveUpdateFuture(PhabricatorRepository $repository, ExecFuture $future, $min_sleep)
 {
     $monogram = $repository->getMonogram();
     $this->log(pht('Resolving update for "%s".', $monogram));
     try {
         list($stdout, $stderr) = $future->resolvex();
     } catch (Exception $ex) {
         $proxy = new PhutilProxyException(pht('Error while updating the "%s" repository.', $repository->getMonogram()), $ex);
         phlog($proxy);
         return time() + $min_sleep;
     }
     if (strlen($stderr)) {
         $stderr_msg = pht('Unexpected output while updating repository "%s": %s', $monogram, $stderr);
         phlog($stderr_msg);
     }
     $smart_wait = $repository->loadUpdateInterval($min_sleep);
     $this->log(pht('Based on activity in repository "%s", considering a wait of %s ' . 'seconds before update.', $repository->getMonogram(), new PhutilNumber($smart_wait)));
     return time() + $smart_wait;
 }
開發者ID:fengshao0907,項目名稱:phabricator,代碼行數:22,代碼來源:PhabricatorRepositoryPullLocalDaemon.php


注:本文中的PhabricatorRepository::loadUpdateInterval方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。