Page MenuHomePhabricator

D10367.id24955.diff
No OneTemporary

D10367.id24955.diff

diff --git a/src/applications/config/check/PhabricatorSetupCheckDaemons.php b/src/applications/config/check/PhabricatorSetupCheckDaemons.php
--- a/src/applications/config/check/PhabricatorSetupCheckDaemons.php
+++ b/src/applications/config/check/PhabricatorSetupCheckDaemons.php
@@ -62,11 +62,18 @@
'configuration. If you are making multiple configuration changes, '.
'you only need to restart the daemons once after the last change.'.
"\n\n".
- 'Use %s to restart daemons. See %s for more information.',
+ 'Use %s to restart daemons. See the %s or %s for more information.',
phutil_tag('tt', array(), 'bin/phd restart'),
phutil_tag(
'a',
array(
+ 'href' => '/daemon/',
+ 'target' => '_blank'
+ ),
+ pht('Daemon Console')),
+ phutil_tag(
+ 'a',
+ array(
'href' => $doc_href,
'target' => '_blank'
),
diff --git a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php
--- a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php
+++ b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php
@@ -64,6 +64,14 @@
}
$header->addTag($tag);
+ $env_hash = PhabricatorEnv::calculateEnvironmentHash();
+ if ($log->getEnvHash() != $env_hash) {
+ $tag = id(new PHUITagView())
+ ->setType(PHUITagView::TYPE_STATE)
+ ->setBackgroundColor(PHUITagView::COLOR_YELLOW)
+ ->setName(pht('Stale Config'));
+ $header->addTag($tag);
+ }
$properties = $this->buildPropertyListView($log);
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogListView.php b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
--- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
@@ -17,6 +17,7 @@
throw new Exception('Call setUser() before rendering!');
}
+ $env_hash = PhabricatorEnv::calculateEnvironmentHash();
$list = new PHUIObjectItemListView();
foreach ($this->daemonLogs as $log) {
$id = $log->getID();
@@ -31,8 +32,15 @@
$status = $log->getStatus();
switch ($status) {
case PhabricatorDaemonLog::STATUS_RUNNING:
- $item->setBarColor('green');
- $item->addAttribute(pht('This daemon is running.'));
+ if ($env_hash != $log->getEnvHash()) {
+ $item->setBarColor('yellow');
+ $item->addAttribute(pht(
+ 'This daemon is running with an out of date configuration and '.
+ 'should be restarted.'));
+ } else {
+ $item->setBarColor('green');
+ $item->addAttribute(pht('This daemon is running.'));
+ }
break;
case PhabricatorDaemonLog::STATUS_DEAD:
$item->setBarColor('red');
diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php
--- a/src/infrastructure/env/PhabricatorEnv.php
+++ b/src/infrastructure/env/PhabricatorEnv.php
@@ -223,6 +223,8 @@
public static function calculateEnvironmentHash() {
$keys = array_keys(self::getAllConfigKeys());
+ asort($keys);
+
$values = array();
foreach ($keys as $key) {
$values[$key] = self::getEnvConfigIfExists($key);

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 5:26 AM (2 h, 1 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6917585
Default Alt Text
D10367.id24955.diff (3 KB)

Event Timeline