当前位置: 首页>>代码示例>>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;未经允许,请勿转载。