1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-29 17:00:59 +01:00

Update Phabricator for DaemonOverseer vs DaemonHandle split

Summary: Ref T7352. A couple of the APIs changed slightly with D11851.

Test Plan: See D11851.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7352

Differential Revision: https://secure.phabricator.com/D11852
This commit is contained in:
epriestley 2015-02-22 07:11:43 -08:00
parent 7c609229a9
commit 6771a70499
4 changed files with 15 additions and 14 deletions

View file

@ -57,7 +57,8 @@ final class PhabricatorDaemonConsoleController
if ($failed) {
// Add the time it takes to restart the daemons. This includes a guess
// about other overhead of 2X.
$usage_total += PhutilDaemonOverseer::RESTART_WAIT * count($failed) * 2;
$restart_delay = PhutilDaemonHandle::getWaitBeforeRestart();
$usage_total += $restart_delay * count($failed) * 2;
foreach ($failed as $failed_task) {
$usage_start = min($usage_start, $failed_task->getFailureTime());
}

View file

@ -112,7 +112,7 @@ final class PhabricatorDaemonLogViewController
$unknown_time = PhabricatorDaemonLogQuery::getTimeUntilUnknown();
$dead_time = PhabricatorDaemonLogQuery::getTimeUntilDead();
$wait_time = PhutilDaemonOverseer::RESTART_WAIT;
$wait_time = PhutilDaemonHandle::getWaitBeforeRestart();
$details = null;
$status = $daemon->getStatus();

View file

@ -5,28 +5,28 @@ final class PhabricatorDaemonEventListener extends PhabricatorEventListener {
private $daemons = array();
public function register() {
$this->listen(PhutilDaemonOverseer::EVENT_DID_LAUNCH);
$this->listen(PhutilDaemonOverseer::EVENT_DID_LOG);
$this->listen(PhutilDaemonOverseer::EVENT_DID_HEARTBEAT);
$this->listen(PhutilDaemonOverseer::EVENT_WILL_GRACEFUL);
$this->listen(PhutilDaemonOverseer::EVENT_WILL_EXIT);
$this->listen(PhutilDaemonHandle::EVENT_DID_LAUNCH);
$this->listen(PhutilDaemonHandle::EVENT_DID_LOG);
$this->listen(PhutilDaemonHandle::EVENT_DID_HEARTBEAT);
$this->listen(PhutilDaemonHandle::EVENT_WILL_GRACEFUL);
$this->listen(PhutilDaemonHandle::EVENT_WILL_EXIT);
}
public function handleEvent(PhutilEvent $event) {
switch ($event->getType()) {
case PhutilDaemonOverseer::EVENT_DID_LAUNCH:
case PhutilDaemonHandle::EVENT_DID_LAUNCH:
$this->handleLaunchEvent($event);
break;
case PhutilDaemonOverseer::EVENT_DID_HEARTBEAT:
case PhutilDaemonHandle::EVENT_DID_HEARTBEAT:
$this->handleHeartbeatEvent($event);
break;
case PhutilDaemonOverseer::EVENT_DID_LOG:
case PhutilDaemonHandle::EVENT_DID_LOG:
$this->handleLogEvent($event);
break;
case PhutilDaemonOverseer::EVENT_WILL_GRACEFUL:
case PhutilDaemonHandle::EVENT_WILL_GRACEFUL:
$this->handleGracefulEvent($event);
break;
case PhutilDaemonOverseer::EVENT_WILL_EXIT:
case PhutilDaemonHandle::EVENT_WILL_EXIT:
$this->handleExitEvent($event);
break;
}

View file

@ -13,11 +13,11 @@ final class PhabricatorDaemonLogQuery
private $allowStatusWrites;
public static function getTimeUntilUnknown() {
return 3 * PhutilDaemonOverseer::HEARTBEAT_WAIT;
return 3 * PhutilDaemonHandle::getHeartbeatEventFrequency();
}
public static function getTimeUntilDead() {
return 30 * PhutilDaemonOverseer::HEARTBEAT_WAIT;
return 30 * PhutilDaemonHandle::getHeartbeatEventFrequency();
}
public function withIDs(array $ids) {