Differential D10894 Diff 26177 src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementFloodWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementFloodWorkflow.php
- This file was added.
| <?php | |||||
| final class PhabricatorWorkerManagementFloodWorkflow | |||||
| extends PhabricatorWorkerManagementWorkflow { | |||||
| public function didConstruct() { | |||||
| $this | |||||
| ->setName('flood') | |||||
| ->setExamples('**flood**') | |||||
| ->setSynopsis( | |||||
| pht( | |||||
| 'Flood the queue with test tasks. This command is intended for '. | |||||
| 'use when developing and debugging Phabricator.')) | |||||
| ->setArguments(array()); | |||||
| } | |||||
| public function execute(PhutilArgumentParser $args) { | |||||
| $console = PhutilConsole::getConsole(); | |||||
| $console->writeOut( | |||||
| "%s\n", | |||||
| pht('Adding many test tasks to worker queue. Use ^C to exit.')); | |||||
| $n = 0; | |||||
| while (true) { | |||||
| PhabricatorWorker::scheduleTask( | |||||
| 'PhabricatorTestWorker', | |||||
| array()); | |||||
| if (($n++ % 100) === 0) { | |||||
| $console->writeOut('.'); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||