Differential D20606 Diff 49171 src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php
<?php | <?php | ||||
final class PhabricatorDaemonManagementStatusWorkflow | final class PhabricatorDaemonManagementStatusWorkflow | ||||
extends PhabricatorDaemonManagementWorkflow { | extends PhabricatorDaemonManagementWorkflow { | ||||
protected function didConstruct() { | protected function didConstruct() { | ||||
$this | $this | ||||
->setName('status') | ->setName('status') | ||||
->setSynopsis(pht('Show daemon processes on this host.')); | ->setSynopsis(pht('Show daemon processes on this host.')); | ||||
} | } | ||||
public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
$query = id(new PhutilProcessQuery()) | $process_refs = $this->getOverseerProcessRefs(); | ||||
->withIsOverseer(true); | |||||
$instance = PhabricatorEnv::getEnvConfig('cluster.instance'); | |||||
if ($instance !== null) { | |||||
$query->withInstances(array($instance)); | |||||
} | |||||
$process_refs = $query->execute(); | |||||
if (!$process_refs) { | if (!$process_refs) { | ||||
$instance = $this->getInstance(); | |||||
if ($instance !== null) { | if ($instance !== null) { | ||||
$this->logInfo( | $this->logInfo( | ||||
pht('NO DAEMONS'), | pht('NO DAEMONS'), | ||||
pht( | pht( | ||||
'There are no running daemon processes for the current '. | 'There are no running daemon processes for the current '. | ||||
'instance ("%s").', | 'instance ("%s").', | ||||
$instance)); | $instance)); | ||||
} else { | } else { | ||||
Show All 33 Lines |