@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.

at recaptime-dev/main 44 lines 1.0 kB view raw
1<?php 2 3final class PhabricatorRebuildIndexesWorker extends PhabricatorWorker { 4 5 public static function rebuildObjectsWithQuery($query_class) { 6 parent::scheduleTask( 7 self::class, 8 array( 9 'queryClass' => $query_class, 10 ), 11 array( 12 'priority' => parent::PRIORITY_INDEX, 13 )); 14 } 15 16 protected function doWork() { 17 $viewer = PhabricatorUser::getOmnipotentUser(); 18 19 $data = $this->getTaskData(); 20 $query_class = idx($data, 'queryClass'); 21 22 try { 23 $query = newv($query_class, array()); 24 } catch (Exception $ex) { 25 throw new PhabricatorWorkerPermanentFailureException( 26 pht( 27 'Unable to instantiate query class "%s": %s', 28 $query_class, 29 $ex->getMessage())); 30 } 31 32 $query->setViewer($viewer); 33 34 $iterator = new PhabricatorQueryIterator($query); 35 foreach ($iterator as $object) { 36 PhabricatorSearchWorker::queueDocumentForIndexing( 37 $object->getPHID(), 38 array( 39 'force' => true, 40 )); 41 } 42 } 43 44}