Page MenuHomePhabricator

D21517.diff
No OneTemporary

D21517.diff

diff --git a/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php b/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php
--- a/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php
+++ b/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php
@@ -21,6 +21,10 @@
'param' => 'int',
'help' => pht('Limit to tasks with at least this many failures.'),
),
+ array(
+ 'name' => 'active',
+ 'help' => pht('Select all active tasks.'),
+ ),
);
}
@@ -28,10 +32,13 @@
$ids = $args->getArg('id');
$class = $args->getArg('class');
$min_failures = $args->getArg('min-failure-count');
+ $active = $args->getArg('active');
- if (!$ids && !$class && !$min_failures) {
+ if (!$ids && !$class && !$min_failures && !$active) {
throw new PhutilArgumentUsageException(
- pht('Use --id, --class, or --min-failure-count to select tasks.'));
+ pht(
+ 'Use "--id", "--class", "--active", and/or "--min-failure-count" '.
+ 'to select tasks.'));
}
$active_query = new PhabricatorWorkerActiveTaskQuery();
@@ -56,7 +63,13 @@
}
$active_tasks = $active_query->execute();
- $archive_tasks = $archive_query->execute();
+
+ if ($active) {
+ $archive_tasks = array();
+ } else {
+ $archive_tasks = $archive_query->execute();
+ }
+
$tasks =
mpull($active_tasks, null, 'getID') +
mpull($archive_tasks, null, 'getID');

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 10:14 PM (19 h, 42 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6787142
Default Alt Text
D21517.diff (1 KB)

Event Timeline