Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/worker/HarbormasterBuildWorker.php
Show All 12 Lines | public function doWork() { | ||||
$data = $this->getTaskData(); | $data = $this->getTaskData(); | ||||
$id = idx($data, 'buildID'); | $id = idx($data, 'buildID'); | ||||
// Get a reference to the build. | // Get a reference to the build. | ||||
$build = id(new HarbormasterBuildQuery()) | $build = id(new HarbormasterBuildQuery()) | ||||
->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
->withBuildStatuses(array(HarbormasterBuild::STATUS_PENDING)) | ->withBuildStatuses(array(HarbormasterBuild::STATUS_PENDING)) | ||||
->withIDs(array($id)) | ->withIDs(array($id)) | ||||
->needBuildPlans(true) | |||||
->executeOne(); | ->executeOne(); | ||||
if (!$build) { | if (!$build) { | ||||
throw new PhabricatorWorkerPermanentFailureException( | throw new PhabricatorWorkerPermanentFailureException( | ||||
pht('Invalid build ID "%s".', $id)); | pht('Invalid build ID "%s".', $id)); | ||||
} | } | ||||
// It's possible for the user to request cancellation before | // It's possible for the user to request cancellation before | ||||
// a worker picks up a build. We check to see if the build | // a worker picks up a build. We check to see if the build | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |