protected function setUp() { $this->_policy = KeeperRestartPolicy::create(1, 1); $this->_policyMax3WithIn2 = KeeperRestartPolicy::create(3, 2); }
protected function setUp() { $this->_policy = KeeperRestartPolicy::create(3, -1); $this->_policy1 = KeeperRestartPolicy::create(1, -1); }
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); }