Page MenuHomePhabricator

D9176.id21865.diff
No OneTemporary

D9176.id21865.diff

diff --git a/conf/default.conf.php b/conf/default.conf.php
--- a/conf/default.conf.php
+++ b/conf/default.conf.php
@@ -940,10 +940,21 @@
// Directory that the Phabricator daemons should use to store the log file
'phd.log-directory' => '/var/tmp/phd/log',
- // Number of "TaskMaster" daemons that "phd start" should start. You can
- // raise this if you have a task backlog, or explicitly launch more with
- // "phd launch <N> taskmaster".
- 'phd.start-taskmasters' => 4,
+ // Daemons that "phd start" should start.
+ 'phd.start-daemons' => array(
+ 'taskmaster' => array(
+ 'type' => 'PhabricatorTaskmasterDaemon',
+ 'count' => 4,
+ ),
+ 'repository-pull' => array(
+ 'type' => 'PhabricatorRepositoryPullLocalDaemon',
+ 'count' => 1,
+ ),
+ 'garbage-collector' => array(
+ 'type' => 'PhabricatorGarbageCollectorDaemon',
+ 'count' => 1,
+ ),
+ ),
// Launch daemons in "verbose" mode by default. This creates a lot of output,
// but can help debug issues. Daemons launched in debug mode with "phd debug"
diff --git a/src/applications/config/option/PhabricatorPHDConfigOptions.php b/src/applications/config/option/PhabricatorPHDConfigOptions.php
--- a/src/applications/config/option/PhabricatorPHDConfigOptions.php
+++ b/src/applications/config/option/PhabricatorPHDConfigOptions.php
@@ -21,13 +21,27 @@
->setDescription(
pht(
"Directory that the daemons should use to store log files.")),
- $this->newOption('phd.start-taskmasters', 'int', 4)
- ->setSummary(pht("Number of TaskMaster daemons to start by default."))
+ $this->newOption(
+ 'phd.start-daemons',
+ 'map<string, map>',
+ array(
+ 'taskmaster' => array(
+ 'type' => 'PhabricatorTaskmasterDaemon',
+ 'count' => 4,
+ ),
+ 'repository-pull' => array(
+ 'type' => 'PhabricatorRepositoryPullLocalDaemon',
+ 'count' => 1,
+ ),
+ 'garbage-collector' => array(
+ 'type' => 'PhabricatorGarbageCollectorDaemon',
+ 'count' => 1,
+ ),
+ ))
+ ->setLocked(true)
+ ->setSummary(pht('Daemons to start by default.'))
->setDescription(
- pht(
- "Number of 'TaskMaster' daemons that 'phd start' should start. ".
- "You can raise this if you have a task backlog, or explicitly ".
- "launch more with 'phd launch <N> taskmaster'.")),
+ pht('Number and type of daemons that `phd start` should start.')),
$this->newOption('phd.verbose', 'bool', false)
->setBoolOptions(
array(
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
@@ -229,14 +229,26 @@
}
}
- $daemons = array(
- array('PhabricatorRepositoryPullLocalDaemon', array()),
- array('PhabricatorGarbageCollectorDaemon', array()),
- );
-
- $taskmasters = PhabricatorEnv::getEnvConfig('phd.start-taskmasters');
- for ($ii = 0; $ii < $taskmasters; $ii++) {
- $daemons[] = array('PhabricatorTaskmasterDaemon', array());
+ $daemons = array();
+ $start_daemons = PhabricatorEnv::getEnvConfig('phd.start-daemons');
+
+ foreach ($start_daemons as $daemon) {
+ $spec = array(
+ 'type' => 'string',
+ 'args' => 'optional list<string>',
+ 'count' => 'optional int',
+ );
+ PhutilTypeSpec::checkMap($daemon, $spec);
+ }
+
+ foreach ($start_daemons as $daemon) {
+ $type = idx($daemon, 'type');
+ $args = idx($daemon, 'args', array());
+ $count = idx($daemon, 'count', 1);
+
+ for ($ii = 0; $ii < $count; $ii++) {
+ $daemons[] = array($type, $args);
+ }
}
$this->willLaunchDaemons();

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 30, 7:34 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7727427
Default Alt Text
D9176.id21865.diff (3 KB)

Event Timeline