Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13979849
D9364.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9364.diff
View Options
diff --git a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
--- a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
+++ b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
@@ -62,8 +62,7 @@
}
if (!$phids) {
- throw new PhutilArgumentUsageException(
- "Nothing to index!");
+ throw new PhutilArgumentUsageException('Nothing to index!');
}
if ($args->getArg('background')) {
@@ -73,27 +72,31 @@
$is_background = false;
}
+ if (!$is_background) {
+ $console->writeOut(
+ "%s\n",
+ pht(
+ 'Run this workflow with "--background" to queue tasks for the '.
+ 'daemon workers.'));
+ }
+
$groups = phid_group_by_type($phids);
foreach ($groups as $group_type => $group) {
$console->writeOut(
"%s\n",
- pht(
- "Indexing %d object(s) of type %s.",
- count($group),
- $group_type));
+ pht('Indexing %d object(s) of type %s.', count($group), $group_type));
}
+ $bar = id(new PhutilConsoleProgressBar())
+ ->setTotal(count($phids));
+
$indexer = new PhabricatorSearchIndexer();
foreach ($phids as $phid) {
- if ($is_background) {
- $console->writeOut("%s\n", pht("Queueing '%s'...", $phid));
- } else {
- $console->writeOut("%s\n", pht("Indexing '%s'...", $phid));
- }
$indexer->queueDocumentForIndexing($phid);
+ $bar->update(1);
}
- $console->writeOut("Done.\n");
+ $bar->done();
}
private function loadPHIDsByNames(array $names) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 6:53 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6735553
Default Alt Text
D9364.diff (1 KB)
Attached To
Mode
D9364: Reduce the verbosity of the `./bin/search index` script.
Attached
Detach File
Event Timeline
Log In to Comment