diff --git a/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php b/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php --- a/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php +++ b/src/infrastructure/daemon/workers/query/PhabricatorWorkerTriggerQuery.php @@ -6,6 +6,8 @@ const ORDER_EXECUTION = 'execution'; const ORDER_VERSION = 'version'; + private $ids; + private $phids; private $versionMin; private $versionMax; private $nextEpochMin; @@ -14,6 +16,16 @@ private $needEvents; private $order = self::ORDER_EXECUTION; + public function withIDs(array $ids) { + $this->ids = $ids; + return $this; + } + + public function withPHIDs(array $phids) { + $this->phids = $phids; + return $this; + } + public function withVersionBetween($min, $max) { $this->versionMin = $min; $this->versionMax = $max; @@ -126,6 +138,20 @@ private function buildWhereClause(AphrontDatabaseConnection $conn_r) { $where = array(); + if ($this->ids !== null) { + $where[] = qsprintf( + $conn_r, + 't.id IN (%Ld)', + $this->ids); + } + + if ($this->phids !== null) { + $where[] = qsprintf( + $conn_r, + 't.phid IN (%Ls)', + $this->phids); + } + if ($this->versionMin !== null) { $where[] = qsprintf( $conn_r,