@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support an "--active" flag for selecting active tasks

Summary: Ref T13591. This is mostly a workaround for Big Sur not having pcntl/posix installed by default and the mess with M1 / Homebrew / SIP / Code Signing (see T13232) so I can't easily run actual daemons and need to fake them with `bin/worker execute --active`, but it's a reasonable flag on its own.

Test Plan:
- Ran `bin/worker execute --active` and `bin/worker cancel --active`.

Maniphest Tasks: T13591

Differential Revision: https://secure.phabricator.com/D21517

+16 -3
+16 -3
src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php
··· 21 21 'param' => 'int', 22 22 'help' => pht('Limit to tasks with at least this many failures.'), 23 23 ), 24 + array( 25 + 'name' => 'active', 26 + 'help' => pht('Select all active tasks.'), 27 + ), 24 28 ); 25 29 } 26 30 ··· 28 32 $ids = $args->getArg('id'); 29 33 $class = $args->getArg('class'); 30 34 $min_failures = $args->getArg('min-failure-count'); 35 + $active = $args->getArg('active'); 31 36 32 - if (!$ids && !$class && !$min_failures) { 37 + if (!$ids && !$class && !$min_failures && !$active) { 33 38 throw new PhutilArgumentUsageException( 34 - pht('Use --id, --class, or --min-failure-count to select tasks.')); 39 + pht( 40 + 'Use "--id", "--class", "--active", and/or "--min-failure-count" '. 41 + 'to select tasks.')); 35 42 } 36 43 37 44 $active_query = new PhabricatorWorkerActiveTaskQuery(); ··· 56 63 } 57 64 58 65 $active_tasks = $active_query->execute(); 59 - $archive_tasks = $archive_query->execute(); 66 + 67 + if ($active) { 68 + $archive_tasks = array(); 69 + } else { 70 + $archive_tasks = $archive_query->execute(); 71 + } 72 + 60 73 $tasks = 61 74 mpull($active_tasks, null, 'getID') + 62 75 mpull($archive_tasks, null, 'getID');