Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorDaemonsSetupCheck.php
<?php | <?php | ||||
final class PhabricatorDaemonsSetupCheck extends PhabricatorSetupCheck { | final class PhabricatorDaemonsSetupCheck extends PhabricatorSetupCheck { | ||||
public function getDefaultGroup() { | public function getDefaultGroup() { | ||||
return self::GROUP_IMPORTANT; | return self::GROUP_IMPORTANT; | ||||
} | } | ||||
protected function executeChecks() { | protected function executeChecks() { | ||||
$task_daemon = id(new PhabricatorDaemonLogQuery()) | try { | ||||
$task_daemons = id(new PhabricatorDaemonLogQuery()) | |||||
->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE) | ->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE) | ||||
->withDaemonClasses(array('PhabricatorTaskmasterDaemon')) | ->withDaemonClasses(array('PhabricatorTaskmasterDaemon')) | ||||
->setLimit(1) | ->setLimit(1) | ||||
->execute(); | ->execute(); | ||||
if (!$task_daemon) { | $no_daemons = !$task_daemons; | ||||
} catch (Exception $ex) { | |||||
// Just skip this warning if the query fails for some reason. | |||||
$no_daemons = false; | |||||
} | |||||
if ($no_daemons) { | |||||
$doc_href = PhabricatorEnv::getDoclink('Managing Daemons with phd'); | $doc_href = PhabricatorEnv::getDoclink('Managing Daemons with phd'); | ||||
$summary = pht( | $summary = pht( | ||||
'You must start the Phabricator daemons to send email, rebuild '. | 'You must start the Phabricator daemons to send email, rebuild '. | ||||
'search indexes, and do other background processing.'); | 'search indexes, and do other background processing.'); | ||||
$message = pht( | $message = pht( | ||||
'The Phabricator daemons are not running, so Phabricator will not '. | 'The Phabricator daemons are not running, so Phabricator will not '. | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |