コード例 #1
0
 protected function setUp()
 {
     $this->_policy = KeeperRestartPolicy::create(1, 1);
     $this->_policyMax3WithIn2 = KeeperRestartPolicy::create(3, 2);
 }
コード例 #2
0
 protected function setUp()
 {
     $this->_policy = KeeperRestartPolicy::create(3, -1);
     $this->_policy1 = KeeperRestartPolicy::create(1, -1);
 }
コード例 #3
0
ファイル: Config.php プロジェクト: jinchunguang/qpm
 private function _initKeeperRestartPolicy($config)
 {
     $max = self::_fetchIntValue($config, 'maxRestartTimes', self::DEFAULT_MAX_RESTART_TIMES);
     if ($max == 0) {
         throw new \InvalidArgumentException('maxRestartTimes must be integer and cannot be zero');
     }
     $withIn = self::_fetchIntValue($config, 'withInSeconds', self::DEFAULT_WITH_IN_SECONDS);
     if ($withIn == 0) {
         throw new \InvalidArgumentException('withInSeconds must be integer and cannot be zero');
     }
     $this->_keeperRestartPolicy = KeeperRestartPolicy::create($max, $withIn);
 }