Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/worker/DrydockLeaseUpdateWorker.php
Show First 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | private function allocateResource( | ||||
// If this resource was allocated as a pending resource, queue a task to | // If this resource was allocated as a pending resource, queue a task to | ||||
// activate it. | // activate it. | ||||
if ($resource->getStatus() == DrydockResourceStatus::STATUS_PENDING) { | if ($resource->getStatus() == DrydockResourceStatus::STATUS_PENDING) { | ||||
PhabricatorWorker::scheduleTask( | PhabricatorWorker::scheduleTask( | ||||
'DrydockResourceUpdateWorker', | 'DrydockResourceUpdateWorker', | ||||
array( | array( | ||||
'resourcePHID' => $resource->getPHID(), | 'resourcePHID' => $resource->getPHID(), | ||||
// This task will generally yield while the resource activates, so | |||||
// wake it back up once the resource comes online. Most of the time, | |||||
// we'll be able to lease the newly activated resource. | |||||
'awakenOnActivation' => array( | |||||
$this->getCurrentWorkerTaskID(), | |||||
), | |||||
), | ), | ||||
array( | array( | ||||
'objectPHID' => $resource->getPHID(), | 'objectPHID' => $resource->getPHID(), | ||||
)); | )); | ||||
} | } | ||||
return $resource; | return $resource; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 338 Lines • Show Last 20 Lines |