mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
Merge pull request #207 from vvavrychuk/daemon
use available api to check daemon status
This commit is contained in:
commit
7dd8851a61
1 changed files with 10 additions and 7 deletions
|
@ -37,12 +37,15 @@ abstract class PhabricatorRepositoryController extends PhabricatorController {
|
||||||
return $response->setContent($page->render());
|
return $response->setContent($page->render());
|
||||||
}
|
}
|
||||||
|
|
||||||
private function isPullDaemonRunningOnThisMachine() {
|
private function isPullDaemonRunning() {
|
||||||
|
$control = new PhabricatorDaemonControl();
|
||||||
// This is sort of hacky, but should probably work.
|
$daemons = $control->loadRunningDaemons();
|
||||||
|
foreach ($daemons as $daemon) {
|
||||||
list($stdout) = execx('ps auxwww');
|
if ($daemon->isRunning() &&
|
||||||
return preg_match('/PhabricatorRepositoryPullLocalDaemon/', $stdout);
|
$daemon->getName() == 'PhabricatorRepositoryPullLocalDaemon')
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function renderDaemonNotice() {
|
protected function renderDaemonNotice() {
|
||||||
|
@ -60,7 +63,7 @@ abstract class PhabricatorRepositoryController extends PhabricatorController {
|
||||||
"<strong>{$documentation}</strong>.";
|
"<strong>{$documentation}</strong>.";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$daemon_running = $this->isPullDaemonRunningOnThisMachine();
|
$daemon_running = $this->isPullDaemonRunning();
|
||||||
if ($daemon_running) {
|
if ($daemon_running) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue